Added spare pallet blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 6m57s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 6m57s
This commit is contained in:
458
resources/views/pdf/spare-pallet.blade.php
Normal file
458
resources/views/pdf/spare-pallet.blade.php
Normal file
@@ -0,0 +1,458 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>SpareLabel</title>
|
||||
|
||||
@php
|
||||
|
||||
$pageHeightMm = 292;
|
||||
$pageWidthMm = 100;
|
||||
$paddingMm = 1.3;
|
||||
|
||||
$headerRows = [
|
||||
'MFG. MONTH & YEAR' => $monthYear,
|
||||
'SALE ORDER NO' => $customerCode,
|
||||
'SUPPLIER NAME' => $customerName,
|
||||
'MASTER BOX NO.' => $masterBox,
|
||||
];
|
||||
|
||||
|
||||
$titleHeight = 10;
|
||||
$headerRowHeight = 5;
|
||||
$itemHeaderHeight = 14;
|
||||
|
||||
// FOOTER SECTION
|
||||
$grossWeightHeight = 5;
|
||||
$netWeightHeight = 5;
|
||||
$licenseHeight = 5;
|
||||
$companyInfoHeight = 6.9;
|
||||
|
||||
$logoHeight = $titleHeight * 0.8;
|
||||
$logoMaxWidth = 20;
|
||||
|
||||
$isilogoHeight = $titleHeight * 0.9;
|
||||
$isilogoMaxWidth = 11;
|
||||
|
||||
$availableHeight = $pageHeightMm - (2 * $paddingMm);
|
||||
|
||||
$itemPages = collect($items)->chunk(40);
|
||||
|
||||
if ($itemPages->isEmpty()) {
|
||||
$itemPages = collect([
|
||||
collect()
|
||||
]);
|
||||
}
|
||||
|
||||
$qrBase64 = 'data:image/png;base64,' . base64_encode(
|
||||
QrCode::format('png')
|
||||
->size(120)
|
||||
->margin(0)
|
||||
->generate($pallet)
|
||||
);
|
||||
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
|
||||
@page {
|
||||
size: 100mm 292mm;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: <?php echo $paddingMm; ?>mm;
|
||||
font-family: DejaVu Sans, sans-serif;
|
||||
font-size: 7px;
|
||||
color: #000;
|
||||
width: <?php echo $pageWidthMm - (2 * $paddingMm); ?>mm;
|
||||
height: <?php echo $availableHeight; ?>mm;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: <?php echo $pageWidthMm - (2 * $paddingMm); ?>mm;
|
||||
height: <?php echo $availableHeight; ?>mm;
|
||||
page-break-after: always;
|
||||
break-after: page;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.page:last-child {
|
||||
page-break-after: auto;
|
||||
break-after: auto;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
border: 0.3px solid #000 !important;
|
||||
vertical-align: middle;
|
||||
line-height: 1 !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.title-row td {
|
||||
height: <?php echo $titleHeight - 0.6; ?>mm !important;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
padding: 0 !important;
|
||||
font-size: 8.5px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
position: absolute;
|
||||
left: 2mm;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: <?php echo min(8, ($titleHeight - 0.6) * 0.6); ?>mm;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.vertical-line {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
border-left: 0.3px solid #000;
|
||||
}
|
||||
|
||||
.vertical-line.left {
|
||||
left: 12mm;
|
||||
}
|
||||
|
||||
.vertical-line.right {
|
||||
right: 12mm;
|
||||
}
|
||||
|
||||
.header-row td {
|
||||
height: <?php echo $headerRowHeight - 0.6; ?>mm !important;
|
||||
padding: 0.2mm 0.5mm !important;
|
||||
}
|
||||
|
||||
.header-row .label {
|
||||
width: 40%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.items-header-row td {
|
||||
height: <?php echo $itemHeaderHeight - 0.6; ?>mm !important;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-size: 6.5px;
|
||||
padding: 0.2mm 0.5mm !important;
|
||||
}
|
||||
|
||||
.item-row td {
|
||||
height: <?php echo 4; ?>mm !important;
|
||||
font-size: 6.5px !important;
|
||||
padding: 0.1mm 0.4mm !important;
|
||||
line-height: 1 !important;
|
||||
}
|
||||
|
||||
.gross-weight-row td {
|
||||
height: <?php echo $grossWeightHeight - 0.6; ?>mm !important;
|
||||
text-align: center;
|
||||
font-size: 6.5px;
|
||||
padding: 0.2mm 0.5mm !important;
|
||||
}
|
||||
|
||||
.net-weight-row td {
|
||||
height: <?php echo $netWeightHeight - 0.6; ?>mm !important;
|
||||
text-align: center;
|
||||
font-size: 6.5px;
|
||||
padding: 0.2mm 0.5mm !important;
|
||||
}
|
||||
|
||||
.license-row td {
|
||||
height: <?php echo $licenseHeight - 0.6; ?>mm !important;
|
||||
text-align: center;
|
||||
font-size: 6.5px;
|
||||
padding: 0.2mm 0.5mm !important;
|
||||
}
|
||||
|
||||
.company-info-row td {
|
||||
height: <?php echo $companyInfoHeight - 0.6; ?>mm !important;
|
||||
font-size: 5.5px;
|
||||
line-height: 0.9 !important;
|
||||
padding: 0.1mm 0.5mm !important;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.col-1 {
|
||||
width: 18%;
|
||||
}
|
||||
|
||||
.col-2 {
|
||||
width: 55%;
|
||||
}
|
||||
|
||||
.col-3 {
|
||||
width: 14%;
|
||||
}
|
||||
|
||||
.col-4 {
|
||||
width: 13%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
@foreach ($itemPages as $pageItems)
|
||||
|
||||
@php
|
||||
|
||||
$numItems = count($pageItems) ?: 1;
|
||||
|
||||
$fixedSpace = $titleHeight + (4 * $headerRowHeight) + $itemHeaderHeight + $netWeightHeight + $licenseHeight + $companyInfoHeight;
|
||||
|
||||
$fixedRowCount = 1 /* title */
|
||||
+ 4 /* header rows */
|
||||
+ 1 /* items header */
|
||||
+ 1 /* net weight */
|
||||
+ 1 /* license */
|
||||
+ 1; /* company info */
|
||||
|
||||
$desiredBottomGap = 5;
|
||||
|
||||
$spaceForItemsOnly = $availableHeight - $fixedSpace + ($fixedRowCount * 0.6) - $desiredBottomGap;
|
||||
|
||||
$itemRowHeight = ($spaceForItemsOnly / $numItems) + 0.6;
|
||||
|
||||
$maxItemRowHeight = 5;
|
||||
|
||||
if ($itemRowHeight > $maxItemRowHeight) {
|
||||
$itemRowHeight = $maxItemRowHeight;
|
||||
}
|
||||
|
||||
$itemRowHeight = floor($itemRowHeight * 10) / 10;
|
||||
|
||||
if ($itemRowHeight < 3) {
|
||||
|
||||
$itemFontSize = '5.5px';
|
||||
|
||||
$itemPadding = '0.1mm 0.3mm';
|
||||
|
||||
} elseif ($itemRowHeight < 3.5) {
|
||||
|
||||
$itemFontSize = '6px';
|
||||
|
||||
$itemPadding = '0.1mm 0.4mm';
|
||||
|
||||
} elseif ($itemRowHeight < 4) {
|
||||
|
||||
$itemFontSize = '6.5px';
|
||||
|
||||
$itemPadding = '0.1mm 0.5mm';
|
||||
|
||||
} else {
|
||||
|
||||
$itemFontSize = '7px';
|
||||
|
||||
$itemPadding = '0.2mm 0.5mm';
|
||||
}
|
||||
|
||||
$compensatedItemHeight = $itemRowHeight - 0.6;
|
||||
|
||||
$pageTotalQuantity = $pageItems->sum('weight');
|
||||
|
||||
@endphp
|
||||
|
||||
<div class="page">
|
||||
|
||||
<style>
|
||||
|
||||
.page .item-row{
|
||||
height: <?php echo $compensatedItemHeight; ?>mm !important;
|
||||
font-size: <?php echo $itemFontSize; ?> !important;
|
||||
padding: <?php echo $itemPadding; ?> !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<table>
|
||||
|
||||
<tr class="title-row">
|
||||
|
||||
<td colspan="4">
|
||||
|
||||
<div class="vertical-line left"></div>
|
||||
|
||||
<img
|
||||
src="<?php echo public_path('images/crilogo1.png'); ?>"
|
||||
class="logo"
|
||||
alt="CRI Logo"
|
||||
|
||||
style="
|
||||
height: <?php echo $logoHeight; ?>mm;
|
||||
max-width: <?php echo $logoMaxWidth; ?>mm;
|
||||
width: auto;
|
||||
"
|
||||
>
|
||||
Master Packing Slip
|
||||
<div class="vertical-line right"></div>
|
||||
<img
|
||||
src="{{ $qrBase64 }}"
|
||||
style="
|
||||
position: absolute;
|
||||
bottom: 0.8mm;
|
||||
right: 2mm;
|
||||
width: 8mm;
|
||||
height: 7.8mm;
|
||||
"
|
||||
>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php foreach ($headerRows as $label => $value): ?>
|
||||
|
||||
<tr class="header-row">
|
||||
|
||||
<td class="label">
|
||||
<?php echo $label; ?>
|
||||
</td>
|
||||
|
||||
<td colspan="3">
|
||||
<?php echo $value; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<tr class="items-header-row">
|
||||
<td class="col-1 center">MATERIAL CODE</td>
|
||||
<td class="col-2 center">DESCRIPTION</td>
|
||||
<td class="col-3 center">QTY in kg</td>
|
||||
<td class="col-4 center">NO. OF BOXES</td>
|
||||
</tr>
|
||||
|
||||
@if ($pageItems->count() > 0)
|
||||
|
||||
@foreach ($pageItems as $item)
|
||||
|
||||
<tr class="item-row">
|
||||
|
||||
<td class="col-1 center">
|
||||
<?php echo $item->code; ?>
|
||||
</td>
|
||||
|
||||
<td class="col-2" style="white-space: nowrap;">
|
||||
<?php echo $item->description; ?>
|
||||
</td>
|
||||
|
||||
<td class="col-3 right">
|
||||
<?php echo number_format($item->weight, 3); ?>
|
||||
</td>
|
||||
|
||||
<td class="col-4 center">
|
||||
<?php echo $item->box_count; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
@else
|
||||
|
||||
<tr class="item-row">
|
||||
|
||||
<td colspan="4" class="center">
|
||||
No items available
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endif
|
||||
|
||||
<tr class="net-weight-row">
|
||||
|
||||
<td colspan="2" class="label center">
|
||||
TOTAL QUANTITY
|
||||
</td>
|
||||
|
||||
<td colspan="2" class="center">
|
||||
<?php echo number_format($pageTotalQuantity, 3); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr class="license-row">
|
||||
|
||||
<td colspan="4" class="center">
|
||||
|
||||
MANUFACTURERS
|
||||
|
||||
|
||||
MADE IN INDIA
|
||||
|
||||
|
||||
*Under License
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr class="company-info-row">
|
||||
|
||||
<td colspan="4" class="center">
|
||||
C.R.I. PUMPS PRIVATE LIMITED
|
||||
<br>
|
||||
|
||||
(Unit of {{ $plantName }})
|
||||
<br>
|
||||
|
||||
{{ $plantAddress }}
|
||||
<br>
|
||||
|
||||
India Regd.Office :
|
||||
7/46-1, Keeranatham Road,
|
||||
Saravanampatti,
|
||||
Coimbatore- 641 035
|
||||
<br>
|
||||
|
||||
For Feedback/Complaint:
|
||||
C.R.I. Customer care cell
|
||||
Toll-Free: 1800 121 1243
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user