Added brand plant name in sticker pdf service
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-12-05 14:46:34 +05:30
parent 34071b6d1e
commit 584c877860

View File

@@ -1098,6 +1098,7 @@ class StickerPdfService
if ($row->design_element_type == 'Text') {
$textValue = $row->string_value ?? '';
$configuredTextValue = $textValue;
if ($row->element_type == 'Dynamic' && isset($dynamicValueMap[$row->id]) &&
!in_array($row->characteristics_type, [
@@ -1282,6 +1283,32 @@ class StickerPdfService
$textValue = $cName->name;
}
}
if ($row->characteristics_type == 'brand_plant_name') {
$column = 'zmm_brand';
$textValue = $itemCharacteristic?->{$column} != null
? $itemCharacteristic->{$column}
: '';
if($textValue == 'TORMAC'){
$cName = Company::where('name', 'TORMAC')->first();
$pName = Plant::where('company_id', $cName->id)->first();
$textValue = $pName->name;
}
else if($textValue == 'CRI'){
$textValue = $configuredTextValue ?? 'CRI';
}
else if($textValue == 'GENVIK'){
$cName = Company::where('name', 'GENVIK')->first();
$pName = Plant::where('company_id', $cName->id)->first();
$textValue = $pName->name;
}
else if($textValue == 'ZIRANTEC'){
$cName = Company::where('name', 'ZIRANTEC')->first();
$pName = Plant::where('company_id', $cName->id)->first();
$textValue = $pName->name;
}
}
if ($row->characteristics_type == 'tollfree') {
$column = 'zmm_brand';
@@ -1748,11 +1775,16 @@ class StickerPdfService
// );
$alignment = strtolower($element['string_align'] ?? '');
$pdf->SetFont($element['font'], '', $element['size']);
// $pdf->SetFont($element['font'], '', $element['size']);
$font = $element['font'] ?? 'helvetica';
// $font = $element['font'] ?? 'helvetica';
// $fontSize = (float) ($element['size'] ?? 10);
$font = 'dejavusans';
$fontSize = (float) ($element['size'] ?? 10);
$pdf->SetFont($font, '', $fontSize);
// if (
// ($element['characteristics_type'] ?? '') == 'feed_address'
// && mb_strlen((string) $textValue) > 61