Fix: Adding Comments to Fulfillment Services
This commit is contained in:
1 parent
cbb76070d9
commit
162827dff7
6 files changed
+30
-1
No files matched your search
@@ -72,6 +72,11 @@ class AcsFulfillmentService implements CarrierFulfillmentInterface, SupportsExtr
|
||||
'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'
|
||||
? (float) ($request->amountToCollect ?? $order->total->decimal)
|
||||
: null;
|
||||
|
||||
@@ -63,6 +63,11 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch
|
||||
$weight = $request->weight ?? 0.5;
|
||||
$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 = [
|
||||
'pel_apost_code' => config('elta.apost_code'),
|
||||
'pel_paral_name' => trim("{$address->first_name} {$address->last_name}"),
|
||||
@@ -78,7 +83,7 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch
|
||||
'pel_y' => '',
|
||||
'pel_z' => '',
|
||||
'pel_temaxia' => (string) $request->packageCount,
|
||||
'pel_paral_sxolia' => '',
|
||||
'pel_paral_sxolia' => $remarks,
|
||||
'pel_sur_1' => $surcharges[0] ?? '',
|
||||
'pel_sur_2' => $surcharges[1] ?? '',
|
||||
'pel_sur_3' => $surcharges[2] ?? '',
|
||||
@@ -129,6 +134,7 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch
|
||||
'meta' => [
|
||||
'carrier_id' => $this->findPendingVoucherId((string) $order->reference),
|
||||
'reference' => (string) $order->reference,
|
||||
'delivery_instructions' => $remarks ?: null,
|
||||
'weight' => $weight,
|
||||
'package_count' => $pieces,
|
||||
'cod_amount' => $codAmount,
|
||||
|
||||
@@ -240,6 +240,11 @@ class EltaLabelRenderer
|
||||
// older vouchers were sent the order id).
|
||||
'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
|
||||
// extra services, in ELTA's own wording and slots.
|
||||
'sur_1' => $surcharges[1],
|
||||
|
||||
Reference in new issue
Block a user