solved bug in current date issue
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Larastan / larastan (pull_request) Failing after 4m10s
Laravel Pint / pint (pull_request) Successful in 4m6s

This commit is contained in:
dhanabalan
2026-10-04 15:30:31 +05:30
parent 4eb316cf34
commit bb1c54f094

View File

@@ -1646,11 +1646,29 @@ class StickerPdfService
$pdf->AddPage();
$serialString = (string) $serial;
$serialDate = '';
$firstSerial = $serial;
$secondSerial = $serial + 1;
$serialString = (string) $firstSerial;
$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') {
@@ -1668,16 +1686,8 @@ class StickerPdfService
$textValue = '';
}
}
if (strlen($serialString) >= 4) {
$year = substr($serialString, 0, 2);
$month = substr($serialString, 2, 2);
if ((int) $month >= 1 && (int) $month <= 12) {
$textValue = \Carbon\Carbon::createFromFormat(
'y-m',
$year . '-' . $month
)->format('M-y');
}
if ($textValue == '__CURRENT_DATE__') {
$textValue = $serialDate;
}
$pdf->SetFont(