Added current date logic for single pump
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 3m58s
Laravel Larastan / larastan (pull_request) Failing after 5m40s

This commit is contained in:
dhanabalan
2026-10-04 15:35:09 +05:30
parent bb1c54f094
commit 799102362a

View File

@@ -1515,6 +1515,24 @@ class StickerPdfService
$pdf->AddPage();
$qrContent = $itemCode . '|' . $serial;
$serialString = (string) $serial;
$serialDate = '';
if (strlen($serialString) >= 4) {
$year = substr($serialString, 0, 2);
$month = substr($serialString, 2, 2);
if ((int) $month >= 1 && (int) $month <= 12) {
$serialDate = \Carbon\Carbon::createFromFormat(
'y-m',
$year . '-' . $month
)->format('M-y');
}
}
foreach ($template['elements'] as $element) {
if ($element['type'] == 'text') {
@@ -1524,6 +1542,9 @@ class StickerPdfService
if ($textValue == '__SERIAL_NUMBER__') {
$textValue = (string) $serial;
}
if ($textValue == '__CURRENT_DATE__') {
$textValue = $serialDate;
}
$pdf->SetFont($element['font'],'',$element['size']);