Compare commits
37 Commits
e9eb5539d3
...
renovate/e
| Author | SHA1 | Date | |
|---|---|---|---|
| c841ff830d | |||
| f99bc12603 | |||
|
|
2b3d423769 | ||
| efd469e07d | |||
|
|
e0ed67dfc0 | ||
| dd88bdca78 | |||
|
|
efd5416ced | ||
| 229a69b82a | |||
|
|
03df2f50dc | ||
| 3d404d93ef | |||
|
|
aaaa021597 | ||
| d1f170440c | |||
|
|
78961a7436 | ||
| 01bda8f736 | |||
|
|
f0bb74690f | ||
| 0b83b7cb22 | |||
|
|
88e00b2f8a | ||
| 3bb3674d39 | |||
|
|
ab79a2235a | ||
| f02598feeb | |||
|
|
c17bc3be3a | ||
| f84a579224 | |||
|
|
4edac7987d | ||
| 15241feae2 | |||
|
|
9cbeb5166f | ||
| 4915d12c7d | |||
|
|
46f1ecd7be | ||
| 44779683fd | |||
|
|
05a3c9f7ac | ||
| 82cb39feb5 | |||
|
|
3c5f9f7273 | ||
| 9db03a4c56 | |||
|
|
cef8415b2c | ||
| 3140a1e88d | |||
|
|
7b71f07f39 | ||
| 58b2df8d94 | |||
|
|
4bade21e10 |
@@ -337,7 +337,7 @@ class Scheduler extends Command
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Daily':
|
case 'Daily':
|
||||||
if (now()->format('H:i') == '11:10') {
|
if (now()->format('H:i') == '11:30') {
|
||||||
try {
|
try {
|
||||||
\Artisan::call('send-import-transit', [
|
\Artisan::call('send-import-transit', [
|
||||||
'schedule_type' => $rule->schedule_type,
|
'schedule_type' => $rule->schedule_type,
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ use App\Models\AlertMailRule;
|
|||||||
use App\Models\ImportTransit;
|
use App\Models\ImportTransit;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use App\Exports\ImportTransitReportExport;
|
||||||
|
|
||||||
class SendImportTransit extends Command
|
class SendImportTransit extends Command
|
||||||
{
|
{
|
||||||
@@ -58,37 +60,45 @@ class SendImportTransit extends Command
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$tableData = ImportTransit::select([
|
// $tableData = ImportTransit::select([
|
||||||
'cri_rfq_number',
|
// 'cri_rfq_number',
|
||||||
'mail_received_date',
|
// 'mail_received_date',
|
||||||
'pricol_ref_number',
|
// 'pricol_ref_number',
|
||||||
'requester',
|
// 'requester',
|
||||||
'shipper',
|
// 'shipper',
|
||||||
'shipper_location',
|
// 'shipper_location',
|
||||||
'shipper_invoice',
|
// 'shipper_invoice',
|
||||||
'shipper_invoice_date',
|
// 'shipper_invoice_date',
|
||||||
'customs_agent_name',
|
// 'customs_agent_name',
|
||||||
'eta_date',
|
// 'eta_date',
|
||||||
'status',
|
// 'status',
|
||||||
'delivery_location',
|
// 'delivery_location',
|
||||||
'etd_date',
|
// 'etd_date',
|
||||||
'mode',
|
// 'mode',
|
||||||
'inco_terms',
|
// 'inco_terms',
|
||||||
'port_of_loading',
|
// 'port_of_loading',
|
||||||
'port_of_discharge',
|
// 'port_of_discharge',
|
||||||
'delivery_city',
|
// 'delivery_city',
|
||||||
'packages',
|
// 'packages',
|
||||||
'type_of_package',
|
// 'type_of_package',
|
||||||
'gross_weight',
|
// 'gross_weight',
|
||||||
'volume',
|
// 'volume',
|
||||||
'bill_number',
|
// 'bill_number',
|
||||||
'bill_received_date',
|
// 'bill_received_date',
|
||||||
'vessel_number',
|
// 'vessel_number',
|
||||||
'remark',
|
// 'remark',
|
||||||
'is_transit_identified',
|
// 'is_transit_identified',
|
||||||
])
|
// ])
|
||||||
->where('status', '!=', 'Delivered')
|
// ->where('status', '!=', 'Delivered')
|
||||||
->get();
|
// ->get();
|
||||||
|
|
||||||
|
$tableData = ImportTransit::where('status', '!=', 'Delivered')->orderByRaw("
|
||||||
|
CAST(
|
||||||
|
regexp_replace(cri_rfq_number, '.*-([0-9]+).*', '\\1')
|
||||||
|
AS INTEGER
|
||||||
|
)
|
||||||
|
")->get();
|
||||||
|
|
||||||
|
|
||||||
if ($tableData->isEmpty()) {
|
if ($tableData->isEmpty()) {
|
||||||
$this->info('No pending Import Transit records found. Mail skipped.');
|
$this->info('No pending Import Transit records found. Mail skipped.');
|
||||||
@@ -101,10 +111,19 @@ class SendImportTransit extends Command
|
|||||||
|
|
||||||
$mailSubject = 'Daily Import Transit Report';
|
$mailSubject = 'Daily Import Transit Report';
|
||||||
|
|
||||||
|
$fileName = 'reports/pending_import_shipment_' . now()->format('Ymd_His') . '.xlsx';
|
||||||
|
|
||||||
|
Excel::store(
|
||||||
|
new ImportTransitReportExport($tableData),
|
||||||
|
$fileName,
|
||||||
|
'local'
|
||||||
|
);
|
||||||
|
|
||||||
$mail = new ImportTransitMail(
|
$mail = new ImportTransitMail(
|
||||||
$scheduleType,
|
$scheduleType,
|
||||||
$tableData,
|
$tableData,
|
||||||
$mailSubject
|
$mailSubject,
|
||||||
|
$fileName
|
||||||
);
|
);
|
||||||
|
|
||||||
$toEmails = collect(explode(',', $rule->email))
|
$toEmails = collect(explode(',', $rule->email))
|
||||||
|
|||||||
97
app/Exports/ImportTransitReportExport.php
Normal file
97
app/Exports/ImportTransitReportExport.php
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports;
|
||||||
|
|
||||||
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Style\Fill;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Maatwebsite\Excel\Events\AfterSheet;
|
||||||
|
|
||||||
|
class ImportTransitReportExport implements FromCollection, WithHeadings, WithMapping, WithEvents
|
||||||
|
{
|
||||||
|
protected $data;
|
||||||
|
|
||||||
|
public function __construct($data)
|
||||||
|
{
|
||||||
|
$this->data = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function headings(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'No',
|
||||||
|
'CRI RFQ Number',
|
||||||
|
'Requestor',
|
||||||
|
'Shipper',
|
||||||
|
'Shipper Location',
|
||||||
|
'Shipper Invoice',
|
||||||
|
'Shipper Invoice Date',
|
||||||
|
'Custom Agent Name',
|
||||||
|
'ETA',
|
||||||
|
'Status',
|
||||||
|
'Delivery Location',
|
||||||
|
'ETD Date',
|
||||||
|
'Remark',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function collection()
|
||||||
|
{
|
||||||
|
return collect($this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function map($row): array
|
||||||
|
{
|
||||||
|
static $srNo = 0;
|
||||||
|
$srNo++;
|
||||||
|
|
||||||
|
return [
|
||||||
|
$srNo,
|
||||||
|
$row->cri_rfq_number,
|
||||||
|
$row->requester,
|
||||||
|
$row->shipper,
|
||||||
|
$row->shipper_location,
|
||||||
|
$row->shipper_invoice,
|
||||||
|
$row->shipper_invoice_date,
|
||||||
|
$row->customs_agent_name,
|
||||||
|
$row->eta_date,
|
||||||
|
$row->status,
|
||||||
|
$row->delivery_location,
|
||||||
|
$row->etd_date,
|
||||||
|
$row->remark,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
|
||||||
|
$rowNumber = 2; // Excel row starts after header
|
||||||
|
|
||||||
|
foreach ($this->data as $row) {
|
||||||
|
|
||||||
|
if ((int) $row->is_transit_identified == 1) {
|
||||||
|
|
||||||
|
$event->sheet
|
||||||
|
->getStyle("A{$rowNumber}:M{$rowNumber}")
|
||||||
|
->applyFromArray([
|
||||||
|
'fill' => [
|
||||||
|
'fillType' => Fill::FILL_SOLID,
|
||||||
|
'startColor' => [
|
||||||
|
'rgb' => 'FFFF00',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$rowNumber++;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -285,27 +285,27 @@ class AsrsItemValidationResource extends Resource
|
|||||||
|
|
||||||
$status = $data['status'] ?? 'NotUpdated';
|
$status = $data['status'] ?? 'NotUpdated';
|
||||||
// Hide all records initially if no filters are applied
|
// Hide all records initially if no filters are applied
|
||||||
// if (empty($data['Plant']) && empty($data['item_code']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
if (empty($data['Plant']) && empty($data['item_code']) && empty($data['uom']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||||
// // return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
// $query->where('status', 'NotUpdated');
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (
|
|
||||||
empty($data['Plant']) &&
|
|
||||||
empty($data['item_code']) &&
|
|
||||||
empty($data['uom']) &&
|
|
||||||
empty($data['status']) &&
|
|
||||||
empty($data['created_from']) &&
|
|
||||||
empty($data['created_to'])
|
|
||||||
) {
|
|
||||||
// $query->where('status', 'NotUpdated');
|
// $query->where('status', 'NotUpdated');
|
||||||
$query->where(function ($q) {
|
|
||||||
$q->where('status', 'NotUpdated')
|
|
||||||
->orWhereNull('status')
|
|
||||||
->orWhere('status', '');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (
|
||||||
|
// empty($data['Plant']) &&
|
||||||
|
// empty($data['item_code']) &&
|
||||||
|
// empty($data['uom']) &&
|
||||||
|
// empty($data['status']) &&
|
||||||
|
// empty($data['created_from']) &&
|
||||||
|
// empty($data['created_to'])
|
||||||
|
// ) {
|
||||||
|
// // $query->where('status', 'NotUpdated');
|
||||||
|
// $query->where(function ($q) {
|
||||||
|
// $q->where('status', 'NotUpdated')
|
||||||
|
// ->orWhereNull('status')
|
||||||
|
// ->orWhere('status', '');
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
if (! empty($data['Plant'])) {
|
if (! empty($data['Plant'])) {
|
||||||
$query->where('plant_id', $data['Plant']);
|
$query->where('plant_id', $data['Plant']);
|
||||||
}
|
}
|
||||||
@@ -387,11 +387,12 @@ class AsrsItemValidationResource extends Resource
|
|||||||
Tables\Actions\ViewAction::make(),
|
Tables\Actions\ViewAction::make(),
|
||||||
Tables\Actions\EditAction::make(),
|
Tables\Actions\EditAction::make(),
|
||||||
// ->hidden(function ($record): bool {
|
// ->hidden(function ($record): bool {
|
||||||
// if (auth()->user()?->hasRole('SuperAdmin')) {
|
// if (auth()->user()?->hasRole('Super Admin')) {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
// else{
|
||||||
// return trim(strtolower($record->status)) == 'updated';
|
// return trim(($record->status)) == 'Updated';
|
||||||
|
// }
|
||||||
// }),
|
// }),
|
||||||
// ->visible(function ($record): bool {
|
// ->visible(function ($record): bool {
|
||||||
// return auth()->user()?->hasRole('SuperAdmin')
|
// return auth()->user()?->hasRole('SuperAdmin')
|
||||||
|
|||||||
@@ -40,16 +40,16 @@ class ImportTransitResource extends Resource
|
|||||||
->schema([
|
->schema([
|
||||||
Forms\Components\TextInput::make('cri_rfq_number')
|
Forms\Components\TextInput::make('cri_rfq_number')
|
||||||
->label('CRI/RFQ Number')
|
->label('CRI/RFQ Number')
|
||||||
->disabled(fn ($operation) => $operation == 'edit')
|
->required()
|
||||||
->unique(ignoreRecord: true),
|
->disabled(fn ($operation) => $operation == 'edit'),
|
||||||
Forms\Components\DatePicker::make('mail_received_date')
|
Forms\Components\DatePicker::make('mail_received_date')
|
||||||
->label('Mail Received Date')
|
->label('Mail Received Date')
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\TextInput::make('pricol_ref_number')
|
// Forms\Components\TextInput::make('pricol_ref_number')
|
||||||
->label('Pricol Ref Number')
|
// ->label('Ref Number')
|
||||||
->afterStateUpdated(function (callable $set) {
|
// ->afterStateUpdated(function (callable $set) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
// $set('updated_by', Filament::auth()->user()?->name);
|
||||||
}),
|
// }),
|
||||||
Forms\Components\TextInput::make('requester')
|
Forms\Components\TextInput::make('requester')
|
||||||
->label('Requester')
|
->label('Requester')
|
||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
@@ -75,7 +75,7 @@ class ImportTransitResource extends Resource
|
|||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
}),
|
}),
|
||||||
Forms\Components\DatePicker::make('inv_value')
|
Forms\Components\TextInput::make('inv_value')
|
||||||
->label('Inv Value')
|
->label('Inv Value')
|
||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -220,128 +220,158 @@ class ImportTransitResource extends Resource
|
|||||||
}),
|
}),
|
||||||
Tables\Columns\TextColumn::make('cri_rfq_number')
|
Tables\Columns\TextColumn::make('cri_rfq_number')
|
||||||
->label('CRI/RFQ Number')
|
->label('CRI/RFQ Number')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('mail_received_date')
|
Tables\Columns\TextColumn::make('mail_received_date')
|
||||||
->label('Mail Received Date')
|
->label('Mail Received Date')
|
||||||
|
->searchable()
|
||||||
->date()
|
->date()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('pricol_ref_number')
|
Tables\Columns\TextColumn::make('pricol_ref_number')
|
||||||
->label('Pricol Ref Number')
|
->label('Ref Number')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('requester')
|
Tables\Columns\TextColumn::make('requester')
|
||||||
->label('Requester')
|
->label('Requester')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('shipper')
|
Tables\Columns\TextColumn::make('shipper')
|
||||||
->label('Shipper')
|
->label('Shipper')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('shipper_location')
|
Tables\Columns\TextColumn::make('shipper_location')
|
||||||
->label('Shipper Location')
|
->label('Shipper Location')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('shipper_invoice')
|
Tables\Columns\TextColumn::make('shipper_invoice')
|
||||||
->label('Shipper Invoice')
|
->label('Shipper Invoice')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('shipper_invoice_date')
|
Tables\Columns\TextColumn::make('shipper_invoice_date')
|
||||||
->label('Shipper Invoice Date')
|
->label('Shipper Invoice Date')
|
||||||
|
->searchable()
|
||||||
->date()
|
->date()
|
||||||
->formatStateUsing(fn ($state) => $state?->format('Y-m-d'))
|
->formatStateUsing(fn ($state) => $state?->format('Y-m-d'))
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('inv_value')
|
Tables\Columns\TextColumn::make('inv_value')
|
||||||
->label('Inv Value')
|
->label('Inv Value')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('freight_charge')
|
Tables\Columns\TextColumn::make('freight_charge')
|
||||||
->label('Freight Charge')
|
->label('Freight Charge')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('customs_agent_name')
|
Tables\Columns\TextColumn::make('customs_agent_name')
|
||||||
->label('Customs Agent Name')
|
->label('Customs Agent Name')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('eta_date')
|
Tables\Columns\TextColumn::make('eta_date')
|
||||||
->label('ETA Date')
|
->label('ETA Date')
|
||||||
|
->searchable()
|
||||||
->date()
|
->date()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('status')
|
Tables\Columns\TextColumn::make('status')
|
||||||
->label('Status')
|
->label('Status')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('insurance_status')
|
Tables\Columns\TextColumn::make('insurance_status')
|
||||||
->label('Insurance Status')
|
->label('Insurance Status')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('delivery_location')
|
Tables\Columns\TextColumn::make('delivery_location')
|
||||||
->label('Delivery Location')
|
->label('Delivery Location')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('etd_date')
|
Tables\Columns\TextColumn::make('etd_date')
|
||||||
->label('ETD Date')
|
->label('ETD Date')
|
||||||
|
->searchable()
|
||||||
->date()
|
->date()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('mode')
|
Tables\Columns\TextColumn::make('mode')
|
||||||
->label('Mode')
|
->label('Mode')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('inco_terms')
|
Tables\Columns\TextColumn::make('inco_terms')
|
||||||
->label('Inco Terms')
|
->label('Inco Terms')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('port_of_loading')
|
Tables\Columns\TextColumn::make('port_of_loading')
|
||||||
->label('Port of Loading')
|
->label('Port of Loading')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('port_of_discharge')
|
Tables\Columns\TextColumn::make('port_of_discharge')
|
||||||
->label('Port of Discharge')
|
->label('Port of Discharge')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('delivery_city')
|
Tables\Columns\TextColumn::make('delivery_city')
|
||||||
->label('Delivery City')
|
->label('Delivery City')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('packages')
|
Tables\Columns\TextColumn::make('packages')
|
||||||
->label('Packages')
|
->label('Packages')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('type_of_package')
|
Tables\Columns\TextColumn::make('type_of_package')
|
||||||
->label('Type of Package')
|
->label('Type of Package')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('gross_weight')
|
Tables\Columns\TextColumn::make('gross_weight')
|
||||||
->label('Gross Weight')
|
->label('Gross Weight')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('volume')
|
Tables\Columns\TextColumn::make('volume')
|
||||||
->label('Volume')
|
->label('Volume')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('bill_number')
|
Tables\Columns\TextColumn::make('bill_number')
|
||||||
->label('Bill Number')
|
->label('Bill Number')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('bill_received_date')
|
Tables\Columns\TextColumn::make('bill_received_date')
|
||||||
->label('Bill Received Date')
|
->label('Bill Received Date')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->date()
|
->date()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('vessel_number')
|
Tables\Columns\TextColumn::make('vessel_number')
|
||||||
->label('Vessel Number')
|
->label('Vessel Number')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('remark')
|
Tables\Columns\TextColumn::make('remark')
|
||||||
->label('Remark')
|
->label('Remark')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('is_transit_identified')
|
Tables\Columns\TextColumn::make('is_transit_identified')
|
||||||
->label('Is Transit Identified')
|
->label('Is Transit Identified')
|
||||||
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP'];
|
$typesToCreate = ['MOTOR', 'PUMP'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['PUMP'];
|
$typesToCreate = ['PUMP'];
|
||||||
@@ -673,7 +673,7 @@ class CharacteristicsController extends Controller
|
|||||||
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
|
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
|
||||||
// ], 404);
|
// ], 404);
|
||||||
}
|
}
|
||||||
} elseif (! Str::contains($curHead, 'PUMPS', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true)) {
|
} elseif (! Str::contains($curHead, 'PUMP SET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPS', ignoreCase: true)) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status_code' => 'ERROR',
|
'status_code' => 'ERROR',
|
||||||
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
|
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
|
||||||
@@ -1562,7 +1562,7 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP'];
|
$typesToCreate = ['MOTOR', 'PUMP'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['PUMP'];
|
$typesToCreate = ['PUMP'];
|
||||||
@@ -1941,7 +1941,7 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP'];
|
$typesToCreate = ['MOTOR', 'PUMP'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['PUMP'];
|
$typesToCreate = ['PUMP'];
|
||||||
@@ -2399,7 +2399,7 @@ class CharacteristicsController extends Controller
|
|||||||
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
|
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
|
||||||
// ], 404);
|
// ], 404);
|
||||||
}
|
}
|
||||||
} elseif (! Str::contains($curHead, 'PUMPS', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true)) {
|
} elseif (! Str::contains($curHead, 'PUMP SET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPS', ignoreCase: true)) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status_code' => 'ERROR',
|
'status_code' => 'ERROR',
|
||||||
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
|
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
|
||||||
@@ -3666,7 +3666,7 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP'];
|
$typesToCreate = ['MOTOR', 'PUMP'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['PUMP'];
|
$typesToCreate = ['PUMP'];
|
||||||
@@ -4701,7 +4701,7 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['MOTOR', 'PUMP'];
|
$typesToCreate = ['MOTOR', 'PUMP'];
|
||||||
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
|
||||||
$typesToCreate = ['PUMP'];
|
$typesToCreate = ['PUMP'];
|
||||||
|
|||||||
@@ -25,15 +25,15 @@ class ProductionCheckList extends Component
|
|||||||
|
|
||||||
public $existingRecords = [];
|
public $existingRecords = [];
|
||||||
|
|
||||||
public bool $shouldSkipChecklist = false;
|
// public bool $shouldSkipChecklist = false;
|
||||||
|
|
||||||
public array $checklist = [];
|
public array $checklist = [];
|
||||||
|
|
||||||
public $showChecklist = false;
|
public $showChecklist = false;
|
||||||
|
|
||||||
public $skipChecklistValidation = false;
|
// public $skipChecklistValidation = false;
|
||||||
|
|
||||||
protected $listeners = ['focus-item-id' => 'handleFocus', 'trigger-create' => 'doCreate',];
|
// protected $listeners = ['focus-item-id' => 'handleFocus', 'trigger-create' => 'doCreate',];
|
||||||
|
|
||||||
public $data =
|
public $data =
|
||||||
[
|
[
|
||||||
@@ -45,23 +45,21 @@ class ProductionCheckList extends Component
|
|||||||
'checklist' => [],
|
'checklist' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
#[On('focus-item-id')]
|
// public function doCreate()
|
||||||
public function handleFocus()
|
// {
|
||||||
{
|
// $this->create();
|
||||||
$this->dispatch('focus-input');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function doCreate()
|
|
||||||
{
|
|
||||||
$this->create();
|
|
||||||
|
|
||||||
$this->shouldSkipChecklist = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// $this->shouldSkipChecklist = false;
|
||||||
|
// }
|
||||||
|
|
||||||
public function mount($records = [])
|
public function mount($records = [])
|
||||||
{
|
{
|
||||||
$this->records = collect($records);
|
// $this->records = collect($records);
|
||||||
|
$this->records = $records;
|
||||||
|
|
||||||
|
foreach ($records as $record) {
|
||||||
|
$this->checklist[$record['id']] = 'ok';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancel()
|
||||||
@@ -255,11 +253,10 @@ class ProductionCheckList extends Component
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatedDataChecklist()
|
// public function updatedDataChecklist()
|
||||||
{
|
// {
|
||||||
$this->dispatch('checklistUpdated', $this->data['checklist']);
|
// $this->dispatch('checklistUpdated', $this->data['checklist']);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Illuminate\Mail\Mailable;
|
|||||||
use Illuminate\Mail\Mailables\Content;
|
use Illuminate\Mail\Mailables\Content;
|
||||||
use Illuminate\Mail\Mailables\Envelope;
|
use Illuminate\Mail\Mailables\Envelope;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Mail\Mailables\Attachment;
|
||||||
|
|
||||||
class ImportTransitMail extends Mailable
|
class ImportTransitMail extends Mailable
|
||||||
{
|
{
|
||||||
@@ -20,14 +21,17 @@ class ImportTransitMail extends Mailable
|
|||||||
|
|
||||||
public $mailSubject;
|
public $mailSubject;
|
||||||
|
|
||||||
|
public $excelPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
*/
|
*/
|
||||||
public function __construct($scheduleType, $tableData, $mailSubject)
|
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath)
|
||||||
{
|
{
|
||||||
$this->scheduleType = $scheduleType;
|
$this->scheduleType = $scheduleType;
|
||||||
$this->tableData = $tableData ?? [];
|
$this->tableData = $tableData ?? [];
|
||||||
$this->mailSubject = $mailSubject ?? 'Import Transit';
|
$this->mailSubject = $mailSubject ?? 'Import Transit';
|
||||||
|
$this->excelPath = $excelPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +40,7 @@ class ImportTransitMail extends Mailable
|
|||||||
public function envelope(): Envelope
|
public function envelope(): Envelope
|
||||||
{
|
{
|
||||||
return new Envelope(
|
return new Envelope(
|
||||||
subject: 'Import Transit Mail',
|
subject: 'Import Shipment InTransit Mail',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +49,9 @@ class ImportTransitMail extends Mailable
|
|||||||
*/
|
*/
|
||||||
public function content(): Content
|
public function content(): Content
|
||||||
{
|
{
|
||||||
$greeting = '<b>Dear Sir</b>';
|
$now = now();
|
||||||
|
$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.';
|
||||||
|
|
||||||
//$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';
|
||||||
|
|
||||||
@@ -88,6 +94,14 @@ class ImportTransitMail extends Mailable
|
|||||||
*/
|
*/
|
||||||
public function attachments(): array
|
public function attachments(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [
|
||||||
|
Attachment::fromStorageDisk(
|
||||||
|
'local',
|
||||||
|
$this->excelPath
|
||||||
|
)->as('Import_Transit_Report.xlsx')
|
||||||
|
->withMime(
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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": "^1.9",
|
"erag/laravel-pwa": "^2.0",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<div class="fixed inset-0 flex items-center justify-center z-50">
|
<div class="fixed inset-0 flex items-center justify-center z-50">
|
||||||
|
|
||||||
<div class="bg-white max-h-[80vh] overflow-hidden p-6 rounded-lg shadow-lg pointer-events-auto"
|
{{-- <div class="bg-white max-h-[80vh] overflow-hidden p-6 rounded-lg shadow-lg pointer-events-auto"
|
||||||
style="width:30vw !important; max-width:none !important;">
|
style="width:30vw !important; max-width:none !important;"> --}}
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="bg-white rounded-lg shadow-lg pointer-events-auto
|
||||||
|
w-full max-w-2xl max-h-[90vh] flex flex-col">
|
||||||
|
|
||||||
{{-- @if($records && $records->count()) --}}
|
{{-- @if($records && $records->count()) --}}
|
||||||
@if(!empty($records) && count($records))
|
@if(!empty($records) && count($records))
|
||||||
|
|||||||
@@ -19,13 +19,13 @@
|
|||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 14px;
|
font-size: 10px;
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
}
|
}
|
||||||
th, td {
|
th, td {
|
||||||
border: 1px solid #020813da;
|
border: 1px solid #020813da;
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
text-align: center;
|
text-align: left;
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user