Fix: Adding Comments to Fulfillment Services

This commit is contained in:
2026-09-30 21:22:41 +03:00
parent cbb76070d9
commit 162827dff7
6 changed files with 30 additions and 1 deletions
@@ -206,6 +206,10 @@
{{-- ΠΑΡΑΤΗΡΗΣΕΙΣ --}} {{-- ΠΑΡΑΤΗΡΗΣΕΙΣ --}}
<div class="a6-box" style="top:10.60cm;left:0.10cm;width:5.82cm;height:0.80cm;"> <div class="a6-box" style="top:10.60cm;left:0.10cm;width:5.82cm;height:0.80cm;">
<div class="a6-small-title">* ΠΑΡΑΤΗΡΗΣΕΙΣ *</div> <div class="a6-small-title">* ΠΑΡΑΤΗΡΗΣΕΙΣ *</div>
{{-- sxolia_1/2 (textbox49/50) --}}
@foreach (array_slice($sxolia, 0, 2) as $i => $line)
<div style="position:absolute;top:{{ 0.24 + $i * 0.26 }}cm;left:0.10cm;width:5.62cm;font-size:6pt;line-height:1;white-space:nowrap;overflow:hidden;">{{ $line }}</div>
@endforeach
</div> </div>
@if ($multiPiece) @if ($multiPiece)
@@ -139,6 +139,10 @@
<div class="mc-box" style="top:4.97cm;left:6.60cm;width:4.37cm;height:1.31cm;border-top:none;"> <div class="mc-box" style="top:4.97cm;left:6.60cm;width:4.37cm;height:1.31cm;border-top:none;">
<div style="position:absolute;top:0.03cm;left:0.08cm;font-size:6pt;">* ΠΑΡΑΤΗΡΗΣΕΙΣ *</div> <div style="position:absolute;top:0.03cm;left:0.08cm;font-size:6pt;">* ΠΑΡΑΤΗΡΗΣΕΙΣ *</div>
{{-- sxolia_1..3 (textbox92/95/94) --}}
@foreach ($sxolia as $i => $line)
<div style="position:absolute;top:{{ 0.30 + $i * 0.31 }}cm;left:0.10cm;width:4.18cm;font-size:7pt;line-height:1;white-space:nowrap;overflow:hidden;">{{ $line }}</div>
@endforeach
</div> </div>
{{-- Right-hand signature / print-timestamp column, differs by copy type --}} {{-- Right-hand signature / print-timestamp column, differs by copy type --}}
@@ -73,6 +73,11 @@
<div class="mc-box" style="top:2.45cm;left:6.06cm;width:4.71cm;height:1.17cm;border-bottom:none;"> <div class="mc-box" style="top:2.45cm;left:6.06cm;width:4.71cm;height:1.17cm;border-bottom:none;">
<div style="position:absolute;top:0.02cm;left:0.16cm;font-size:6pt;">Συν.Χρέωσης (€):</div> <div style="position:absolute;top:0.02cm;left:0.16cm;font-size:6pt;">Συν.Χρέωσης (€):</div>
<div style="position:absolute;top:0.30cm;left:0.16cm;font-size:6pt;">Πρόσθετες Υπηρεσίες</div> <div style="position:absolute;top:0.30cm;left:0.16cm;font-size:6pt;">Πρόσθετες Υπηρεσίες</div>
{{-- sxolia_1..3 (textbox91/132/133) sit under this heading in the RDLC;
this stub's boxes are shorter than the RDLC's, so only 2 lines fit. --}}
@foreach (array_slice($sxolia, 0, 2) as $i => $line)
<div style="position:absolute;top:{{ 0.50 + $i * 0.16 }}cm;left:0.16cm;width:4.47cm;font-size:5pt;line-height:1;white-space:nowrap;overflow:hidden;">{{ $line }}</div>
@endforeach
</div> </div>
<div class="mc-box mc-partybox" style="top:3.35cm;left:0.00cm;width:5.97cm;height:1.63cm;overflow:hidden;border-top:none;"> <div class="mc-box mc-partybox" style="top:3.35cm;left:0.00cm;width:5.97cm;height:1.63cm;overflow:hidden;border-top:none;">
@@ -72,6 +72,11 @@ class AcsFulfillmentService implements CarrierFulfillmentInterface, SupportsExtr
'Reference_Key1' => (string) $order->reference, 'Reference_Key1' => (string) $order->reference,
]; ];
// The customer's delivery instructions, for the courier.
if ($instructions = trim(preg_replace('/\s+/u', ' ', (string) $address->delivery_instructions))) {
$params['Delivery_Notes'] = $instructions;
}
$codAmount = $request->paymentMode === 'cod' $codAmount = $request->paymentMode === 'cod'
? (float) ($request->amountToCollect ?? $order->total->decimal) ? (float) ($request->amountToCollect ?? $order->total->decimal)
: null; : null;
@@ -63,6 +63,11 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch
$weight = $request->weight ?? 0.5; $weight = $request->weight ?? 0.5;
$surcharges = $this->surchargeCodes($request); $surcharges = $this->surchargeCodes($request);
// The customer's delivery instructions, as ELTA's remarks
// (ΠΑΡΑΤΗΡΗΣΕΙΣ): one line, at most 90 characters — the ELTA
// client's own field limit.
$remarks = mb_substr(trim(preg_replace('/\s+/u', ' ', (string) $address->delivery_instructions)), 0, 90);
$params = [ $params = [
'pel_apost_code' => config('elta.apost_code'), 'pel_apost_code' => config('elta.apost_code'),
'pel_paral_name' => trim("{$address->first_name} {$address->last_name}"), 'pel_paral_name' => trim("{$address->first_name} {$address->last_name}"),
@@ -78,7 +83,7 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch
'pel_y' => '', 'pel_y' => '',
'pel_z' => '', 'pel_z' => '',
'pel_temaxia' => (string) $request->packageCount, 'pel_temaxia' => (string) $request->packageCount,
'pel_paral_sxolia' => '', 'pel_paral_sxolia' => $remarks,
'pel_sur_1' => $surcharges[0] ?? '', 'pel_sur_1' => $surcharges[0] ?? '',
'pel_sur_2' => $surcharges[1] ?? '', 'pel_sur_2' => $surcharges[1] ?? '',
'pel_sur_3' => $surcharges[2] ?? '', 'pel_sur_3' => $surcharges[2] ?? '',
@@ -129,6 +134,7 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch
'meta' => [ 'meta' => [
'carrier_id' => $this->findPendingVoucherId((string) $order->reference), 'carrier_id' => $this->findPendingVoucherId((string) $order->reference),
'reference' => (string) $order->reference, 'reference' => (string) $order->reference,
'delivery_instructions' => $remarks ?: null,
'weight' => $weight, 'weight' => $weight,
'package_count' => $pieces, 'package_count' => $pieces,
'cod_amount' => $codAmount, 'cod_amount' => $codAmount,
@@ -240,6 +240,11 @@ class EltaLabelRenderer
// older vouchers were sent the order id). // older vouchers were sent the order id).
'order_reference' => $isChild ? null : (string) $order->reference, 'order_reference' => $isChild ? null : (string) $order->reference,
// ΠΑΡΑΤΗΡΗΣΕΙΣ: the remarks we sent ELTA (the customer's delivery
// instructions), in the client's 27-character lines — up to 3
// on A4, the first 2 on A6. Extra parcels print them too.
'sxolia' => array_slice(mb_str_split((string) ($meta['delivery_instructions'] ?? ''), 27), 0, 3),
// sydetaE.rdlc's "Πρόσθετες Υπηρεσίες" (sur_1..4): the ticked // sydetaE.rdlc's "Πρόσθετες Υπηρεσίες" (sur_1..4): the ticked
// extra services, in ELTA's own wording and slots. // extra services, in ELTA's own wording and slots.
'sur_1' => $surcharges[1], 'sur_1' => $surcharges[1],