Added import transit mail page and its blade file #577

Merged
jothi merged 1 commits from ranjith-dev into master 2026-05-08 09:15:25 +00:00
2 changed files with 223 additions and 0 deletions

View File

@@ -0,0 +1,93 @@
<?php
namespace App\Mail;
use DateTime;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class ImportTransitMail extends Mailable
{
use Queueable, SerializesModels;
public $scheduleType;
public $tableData;
public $mailSubject;
/**
* Create a new message instance.
*/
public function __construct($scheduleType, $tableData, $mailSubject)
{
$this->scheduleType = $scheduleType;
$this->tableData = $tableData ?? [];
$this->mailSubject = $mailSubject ?? 'Import Transit';
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Import Transit Mail',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
$greeting = '<b>Dear Sir</b>';
//$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';
if ($this->scheduleType == 'daily') {
$reportPeriod = "The following report presents results";
$greeting .= $reportPeriod;
}
if ($this->scheduleType == 'Hourly') {
$now = now();
$fromHour = $now->copy()->subHour()->format('H:i:s');
$toHour = $now->format('H:i:s');
$reportDate = $now->format('d/m/Y');
$greeting .= "from: $reportDate, $fromHour to $toHour. <br><br>Please arrange to receipt the same immediately.";
}
if ($this->scheduleType == 'Live') {
$now = now();
$fromMinute = $now->copy()->subMinute()->format('d/m/Y H:i:s');
$toMinute = $now->format('d/m/Y H:i:s');
$greeting .= "from: $fromMinute to $toMinute. <br><br>Please arrange to receipt the same immediately.";
}
return new Content(
view: 'mail.import_transit_report',
with: [
'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => $greeting,
'tableData' => $this->tableData,
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}

View File

@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Import Transit Report</title>
<style>
body {
font-family: 'Segoe UI', Arial, sans-serif;
background-color: #f9fafb;
color: #333;
margin: 0;
padding: 0;
}
h2 {
color: #215c98;
text-align: center;
margin-bottom: 20px;
}
table {
border-collapse: collapse;
width: 100%;
font-size: 14px;
white-space: nowrap !important;
}
th, td {
border: 1px solid #020813da;
padding: 8px 10px;
text-align: center;
white-space: nowrap !important;
text-overflow: ellipsis;
}
.td-left {
text-align: left !important;
}
th {
background-color: #215c98;
color: #fff;
white-space: nowrap !important;
}
tr:nth-child(even) {
background-color: #f3f4f6;
}
.footer {
text-align: center;
font-size: 13px;
color: #6b7280;
margin-top: 30px;
}
</style>
</head>
<body>
<div style="text-align: center; font-weight: bold;">
{{ $company }}
</div>
<br>
<p>{!! $greeting !!}</p>
<div class="container">
@if(empty($tableData))
<p style="text-align:center;">No invoice in transit data available.</p>
@else
<table>
<thead>
<tr>
<th>No</th>
<th>CRI RFQ Number</th>
<th>Mail Received Date</th>
<th>Pricol Ref Number</th>
<th>Requestor</th>
<th>Shipper</th>
<th>Shipper Location</th>
<th>Shipper Invoice</th>
<th>Shipper Invoice Date</th>
<th>Custom Agent Name</th>
<th>ETA Date</th>
<th>Status</th>
<th>Delivery Location</th>
<th>ETD Date</th>
<th>Mode</th>
<th>Inco Terms</th>
<th>Port Of Loading</th>
<th>Port Of Discharge</th>
<th>Delivery City</th>
<th>Packages</th>
<th>Type of package</th>
<th>Gross Weight</th>
<th>Volume</th>
<th>Bill Number</th>
<th>Bill Received Date</th>
<th>Vessel Number</th>
</tr>
</thead>
<tbody>
@foreach ($tableData as $row)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $row['cri_rfq_number'] }}</td>
<td>{{ $row['mail_received_date'] }}</td>
<td>{{ $row['pricol_ref_number'] }}</td>
<td>{{ $row['requester'] }}</td>
<td>{{ $row['shipper'] }}</td>
<td>{{ $row['shipper_location'] }}</td>
<td>{{ $row['shipper_invoice'] }}</td>
<td>{{ $row['shipper_invoice_date'] }}</td>
<td>{{ $row['customs_agent_name'] }}</td>
<td>{{ $row['eta_date'] }}</td>
<td>{{ $row['status'] }}</td>
<td>{{ $row['delivery_location'] }}</td>
<td>{{ $row['etd_date'] }}</td>
<td>{{ $row['mode'] }}</td>
<td>{{ $row['inco_terms'] }}</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>{{ $row['vessel_number'] }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
<p>{!! $wishes !!}</p>
</div>
</body>
</html>