From 5ff0d60f5433dd37e2e7c27334b712da038c5b62 Mon Sep 17 00:00:00 2001 From: Konstantinos Arvanitakis Date: Thu, 1 Oct 2026 01:51:13 +0300 Subject: [PATCH] Feature: Shipping Carrier Additions, Creating a voucher without an order, verifying order details before creating voucher, ELTA Courier voucher print updates --- config/shippingCarriers/elta.php | 4 +- docs/elta.md | 709 ++++++++++++++++++ resources/logos/elta-logo.png | Bin 0 -> 63390 bytes .../carriers/elta/label-a4-child.blade.php | 5 +- .../shipping/carriers/elta/label-a4.blade.php | 12 +- .../shipping/carriers/elta/label-a6.blade.php | 8 +- .../elta/partials/_elta-details.blade.php | 15 + .../elta/partials/_main-copy.blade.php | 32 +- .../elta/partials/_payment-stub.blade.php | 187 +++-- .../BoxNow/BoxNowFulfillmentService.php | 201 +++-- src/Shipping/Carriers/Elta/EltaClient.php | 20 +- .../Carriers/Elta/EltaFulfillmentService.php | 350 +++++++-- .../Carriers/Elta/EltaLabelRenderer.php | 148 +++- .../Carriers/Elta/EltaReturnLabel.php | 17 + .../Contracts/CreatesStandaloneVouchers.php | 23 + src/Shipping/DTOs/ShipmentRequest.php | 12 + src/Shipping/DTOs/VoucherRecipient.php | 81 ++ src/Shipping/Enums/ExtraService.php | 3 + .../Extensions/OrderShipmentsExtension.php | 19 + .../Extensions/OrderViewExtension.php | 117 ++- .../Resources/CarrierVoucherResource.php | 84 ++- .../Actions/CreateVoucherAction.php | 86 +++ .../Pages/ListCarrierVouchers.php | 6 +- .../Pages/ViewCarrierVoucher.php | 3 +- .../Filament/Resources/ShipmentResource.php | 8 +- src/Shipping/Filament/Support/VoucherForm.php | 377 ++++++++++ src/Shipping/Models/Shipment.php | 38 + 27 files changed, 2189 insertions(+), 376 deletions(-) create mode 100644 docs/elta.md create mode 100644 resources/logos/elta-logo.png create mode 100644 resources/views/shipping/carriers/elta/partials/_elta-details.blade.php create mode 100644 src/Shipping/Carriers/Elta/EltaReturnLabel.php create mode 100644 src/Shipping/Contracts/CreatesStandaloneVouchers.php create mode 100644 src/Shipping/DTOs/VoucherRecipient.php create mode 100644 src/Shipping/Filament/Resources/CarrierVoucherResource/Actions/CreateVoucherAction.php create mode 100644 src/Shipping/Filament/Support/VoucherForm.php diff --git a/config/shippingCarriers/elta.php b/config/shippingCarriers/elta.php index 014b8cb..7084a65 100644 --- a/config/shippingCarriers/elta.php +++ b/config/shippingCarriers/elta.php @@ -48,7 +48,9 @@ return [ - 'service_location' => env('ELTA_SERVICE_LOCATION', 'http://212.205.47.226:9003'), + // ELTA's current host, over HTTPS. The old 212.205.47.226:9003 still + // answers, but plain HTTP only (see docs/elta.md, A1). + 'service_location' => env('ELTA_SERVICE_LOCATION', 'https://clients.elta-courier.gr'), 'user_code' => env('ELTA_USER_CODE'), 'user_pass' => env('ELTA_USER_PASS'), diff --git a/docs/elta.md b/docs/elta.md new file mode 100644 index 0000000..fcd2a21 --- /dev/null +++ b/docs/elta.md @@ -0,0 +1,709 @@ +# ELTA Courier — API and printing reference + +A reference for designing the ELTA Courier integration, reconstructed from ELTA's own +desktop client ("ELTA Customer Client", `ELTA_PEL.exe`, client version `0032`), decompiled +from ELTA's official installer (`https://www.elta-courier.gr/app/ELTA_COURIER_SETUP.msi`). +The decompiled source lives next to this repo in `../elta-courier-decompiled/` (see its +README); file and line references below point there. Where something was confirmed by +calling ELTA's test account from our integration, it says so. + +Two axes: + +- **Part A — the API**: every SOAP operation, its inputs and outputs, the values the + client sends, and the business rules it enforces before calling. +- **Part B — printing**: what the client prints, when, from which data, with every + fixed text, every image and every formatting rule. + +Part C lists where our current integration (`src/Shipping/Carriers/Elta/`) differs. + +--- + +# Part A — The API + +## A1. Transport + +| | | +|---|---| +| Host | **`https://clients.elta-courier.gr`** (port 443). Verified 2026-09-30: the hostname now resolves to `18.156.16.255` (AWS Frankfurt) and serves HTTPS with a valid certificate; answers are identical to the old host. | +| Old host | `212.205.47.226:9003` (the installer's `hosts-entry.txt`) — **plain HTTP only**: HTTPS there fails the TLS handshake (`SSL_ERROR_SYSCALL`), and `https://clients.elta-courier.gr:9003` fails with `wrong version number` (that port speaks HTTP). | +| Scheme | The client builds its URL as `"https://" + ` (`Form1.cs:213`), i.e. HTTPS on the hostname. | +| Reliability | The HTTPS host was slower (~0.4–0.8 s vs ~0.2 s) and returned one transient HTTP 500 and one 15 s timeout during testing; retry on network errors / 5xx. | +| Protocol | SOAP 1.1, document/literal. One endpoint URL for every operation. | +| Namespace | Each operation has its own: `/` (e.g. `/PELVGNEW`). | +| Body | `` element in that namespace, with each parameter as a child element. | +| SOAPAction | We send `Get` (works); the proxies' `SoapDocumentMethod` arguments weren't decodable. | +| Authentication | None at the HTTP/SOAP level. Account codes travel as ordinary body parameters. `PELLOGINNEW` checks the password; other operations take the account/user code without a password. | +| Proxy | Optional corporate HTTP proxy from `proxy.txt` (`ip;port;user;pass`), with `Expect100Continue = false`. Local-network only; nothing to do with ELTA auth. | +| WSDL | None published for these operations; the shapes come from the client's generated proxies (`ELTA_PEL.pel_*/`). | + +**Every response** carries: + +- `st_flag` — the return value of `READ` (declared `integer`). **`"0"` = success**; anything + else is an error. +- `st_title` — the message (Greek) to show on error, e.g. `Λάθος Τ.Κ.` (wrong postcode), + `Λάθος ΣΥΔΕΤΑ` (wrong voucher), `Δεν Επιτρέπεται! Εχει Γίνει Εκτύπωση` (not allowed, + already printed). + +**Paging convention** (every list operation): a page is at most **100 rows**. If a page +comes back with exactly 100 rows, call again passing the last row's id as the cursor +(`in_id`, `pel_sub_code` or `a_paral_code`, depending on the operation); the client stops +when a page has fewer than 100 (or the 100th row is empty). + +**Number formats**: amounts come back right-aligned in 9 characters (`" 0.00"`); +dates go in as `dd/MM/yyyy`; timestamps come back as `yyyyMMddHHmm[ss]` in Greek local time. + +## A2. Operations at a glance + +| Operation | Purpose | Client screen | +|---|---|---| +| `PELLOGINNEW` | Log in, get account details and the user's station | Login | +| `PELVERNEW` | Latest client version (triggers FTP self-update) | Login | +| `PELLISTNEW` | Sub-senders of a multi-sender account | Login | +| `PELSRV` | Service catalogue | Login | +| `PELSUR` | Surcharge catalogue | **Never called** (surcharges are hardcoded) | +| `PELPARALLIST1` | Saved recipients (address book) | Login | +| `PELTKNEW` | Postcode → station, default service, localities | Voucher entry | +| `PELTK` | Postcode → station, service (older/simpler) | Voucher entry, recipient pick | +| `PELTKBOX` | Postcode → PostBox station and service | Voucher entry (PostBox) | +| `PELTK1` | Is this postcode valid? | File/Excel import | +| `PELVGNEW` | **Create a voucher** (pending or issued) | Voucher entry | +| `PELVGUP` | Edit a pending voucher | Voucher entry (edit mode) | +| `PELVGINNEW` | Create a pending voucher, simplified (bulk) | File/Excel import | +| `PELVG01NEW1` | **Issue** a pending voucher (and re-print an issued one) | Batch processing | +| `PELVGDEL` | Delete a pending voucher | Batch processing | +| `PELPARALVGNEW1` | List pending (and optionally issued) vouchers | Batch processing | +| `PELTTNEW01` | Track one voucher (by voucher number **or reference**) | Tracking | +| `PELMANIF2` | Vouchers in a date range with latest status, by status | Multiple search | +| `PELMANIFNEW` | Index / manifest of vouchers in a date range, with totals | Index report | +| `PELPARALIN` / `PELPARALUP` / `PELPARALSE` | Address book: insert / update / fetch one | Recipients | +| `PELPARALDE` / `PELPARALDE1` | Address book: delete one / delete a code range | Recipients | +| `PELPARALCE` | Address book: check a code and postcode before import | Recipient Excel import | + +## A3. Account and reference data + +### `PELLOGINNEW` — log in + +| In | | +|---|---| +| `pel_code` | Customer (account) code, e.g. test account `999999999` | +| `user_code` | User code (digits only in the client) | +| `user_pass` | Password | + +| Out | | +|---|---| +| `st_title` | Error message | +| `pel_flag` | `"1"` = multi-sender account (has sub-senders, see `PELLISTNEW`); `"0"` = single sender | +| `pel_titles`, `pel_addres`, `pel_area`, `pel_tk`, `pel_tel_1`, `pel_tel_2` | Account name/address/area/postcode/phones — printed as the **sender** on single-sender accounts | +| `user_station` | The user's ELTA station code — sent as `sender_station` to the postcode lookups and to `PELVG01NEW1`, and printed as the deposit station (`Γρ.Κατάθεσης`) | +| `user_pel_code` | The account code to use in every later call (`pel_code` / `pel_apost_code`) | + +After a successful login the client calls `PELVERNEW` (if an FTP address is configured); +if `ag_wupdate_version` > its own version (`0032`) it downloads an update over FTP and +stops. Then it loads the reference lists below. + +### `PELVERNEW` — client version +No inputs. Out: `st_title`, `ag_wupdate_version`. + +### `PELLISTNEW` — sub-senders (multi-sender accounts only) +In: `pel_code` (= `user_pel_code`), `pel_sub_code` (cursor: last code of the previous page, +`""` first). Out: `st_title`, `ag_rec_rec[]` (100/page), `ag_rec_counter`. +Row: `ag_code`, `ag_title`, `ag_adress`, `ag_area`, `ag_tk`, `ag_tel_1`, `ag_tel_2`, +`ag_st` (station), `ag_st_t` (station title). +Used to pick the **sender** of a voucher and the **return-to** party (see special handling). + +### `PELSRV` — service catalogue +No inputs. Out: `st_title`, `ag_srv_rec[]` (up to 150: `ag_code`, `ag_title`), `ag_srv_counter`. +The service picker only offers services whose code starts with the **same two digits** as +the one the postcode lookup returned (same family). + +### `PELSUR` — surcharge catalogue +No inputs. Out: `ag_sur_rec[]` (`ag_code`, `ag_title`). **The client never calls it**; its +surcharges are hardcoded (see A5). + +### `PELPARALLIST1` — saved recipients +In: `pel_code`, `a_paral_code` (cursor). Out: `ag_rec_rec[]` (100/page: `ag_code`, +`ag_title`, `ag_adress`, `ag_area`, `ag_tk`, `ag_tel_1`, `ag_tel_2`), `ag_rec_counter`. + +## A4. Postcode, station and service lookups + +### `PELTKNEW` — the main lookup +In: `pel_tk` (postcode), `sender_station` (= `user_station`). + +| Out | | +|---|---| +| `pel_fields.rec_station`, `rec_station_t` | Destination station code and title (`Γρ. Επίδοσης`) | +| `pel_fields.pel_service`, `pel_service_t` | Default service for that postcode | +| `pel_fields.pel_service_t201`, `pel_service_t231` | Titles of services 201 and 231 (see localities) | +| `a_lview_data[]` | Up to 300 **localities** within the postcode | +| `locations_counter` | Number of localities; `"0"` = none, use `pel_service` as is | + +Locality row: `wloc_code`, `wloc_title`, `wloc_county`, `wloc_countyt`, `wloc_station`, +`wloc_stationt`, `wloc_distance` (decimal), `wloc_postal_code`, `wloc_coordinate_x`, +`wloc_coordinate_y`, `wloc_disp_flag`, `wloc_comments`. + +**When a postcode has localities**, the user must pick one (`Sydeta.cs:3320`): + +- the recipient **area** becomes `"/"`; +- `wloc_disp_flag = "1"` (hard to reach, `ΔΥΣΠΡΟΣΙΤΟ`) → service **`231`** + `ΠΟΛΗ ΠΟΛΗ -ΠΠ- ΔΥΣΠΡΟΣΙΤΟ`; otherwise service **`201`** `ΕΝΤΟΣ ΠΟΛΗΣ -ΠΠ- ΕΠΟΜΕΝΗ`. + +### `PELTK` — simple lookup +In: `pel_tk`, `sender_station`. Out: `st_title`, `rec_station`, `rec_station_t`, +`pel_service`, `pel_service_t`. Used when a saved recipient is picked. + +### `PELTKBOX` — PostBox lookup +In: `pel_tk`, `sender_station`. Out: `st_title`, `pel_fields` (`rec_station`, +`rec_station_t`, `pel_service`, `pel_service_t`). Used instead of `PELTKNEW` when +"ΕΠΙΔΟΣΗ POST BOX" is ticked; on error the PostBox option is unticked. + +### `PELTK1` — validate a postcode +In: `pel_tk`. Out: `st_title` (`st_flag` ≠ 0 = invalid). Used by the bulk imports. + +## A5. Vouchers (ΣΥ.ΔΕ.ΤΑ.) + +### Lifecycle + +``` +PELVGNEW (pel_insert_flag "0") ─► pending: has pel_vg_id, no voucher number + │ │ editable (PELVGUP), deletable (PELVGDEL) + │ ▼ + │ PELVG01NEW1 (issue) ─► issued: voucher number, OCR line, + │ stations, service; child numbers + └── (pel_insert_flag "1") ─► issued immediately, same outputs as PELVGNEW +``` + +- **Only pending vouchers can be deleted.** An issued one is refused (`Δεν Επιτρέπεται! + Εχει Γίνει Εκτύπωση`). Confirmed on the test account. +- In the client, **issuing = printing**: "Print" in batch processing calls `PELVG01NEW1` + and prints the result. It calls `PELVG01NEW1` for already-issued rows too, so it also + serves to **re-print** (ELTA returns the existing voucher's data). +- A **multi-parcel** send is **one** voucher record (`pel_temaxia` > 1). The extra parcels + get their own numbers (`vg_child_no[]`) only when the voucher is issued. They are not + separately listed, deletable or trackable (tracking an extra parcel's number returns + `Λάθος ΣΥΔΕΤΑ` — confirmed). + +### `PELVGNEW` — create a voucher + +The client's call (`Sydeta.cs:1550`), in order: + +| # | Parameter | Client value | Notes / rules | +|---|---|---|---| +| 1 | `pel_apost_code` | Sender code: `user_pel_code` (single-sender), or the chosen sub-sender | Required | +| 2 | `pel_paral_name` | Recipient name | Required; up to 150 chars in the form | +| 3 | `pel_paral_address` | Recipient address | Required; up to 150 | +| 4 | `pel_paral_area` | Recipient area (or `"/"`) | Up to 40 | +| 5 | `pel_paral_tk` | Postcode | Required; 5 digits | +| 6 | `pel_paral_thl_1` | Phone | Digits only, up to 10. **At least one of the two phones is required** | +| 7 | `pel_paral_thl_2` | Mobile | Up to 10. PostBox: required, 10 digits, starting `69` | +| 8 | `pel_service` | Service code from the postcode lookup / picker | **Required** by the client (`Δεν Εχει Οριστεί Υπηρεσία`). We send `""` and ELTA assigns one on issue — works on the test account | +| 9 | `pel_baros` | Weight in kg, `.` decimal | **Required, > 0** | +| 10 | `pel_baros_xyz` | Volumetric weight: **X × Y × Z (cm) ÷ 5000**, 3 decimals | Only when dimensions are given | +| 11–13 | `pel_x`, `pel_y`, `pel_z` | Dimensions in cm, integers up to 3 digits | All three > 0 or none (`Λάθος Διαστάσεις`) | +| 14 | `pel_temaxia` | Number of pieces | **Required, 1–20** (`Μέγιστος Επιτρεπόμενος Αριθμός Τεμαχίων 20.`) | +| 15 | `pel_paral_sxolia` | Remarks **+ envelope/parcel flag**, see below | Remarks up to **90** chars | +| 16 | `pel_sur_1` | `002` special handling, or `917` PostBox | Fixed slot, see below | +| 17 | `pel_sur_2` | `003` set delivery time | Fixed slot | +| 18 | `pel_sur_3` | `004` Saturday delivery | Fixed slot | +| 19 | `pel_ant_poso` | **COD cash** amount | `.` decimal | +| 20–23 | `pel_ant_poso1`…`4` | COD **cheque** amounts (up to 4 cheques) | | +| 24–27 | `pel_ant_date1`…`4` | Each cheque's due date, `dd/MM/yyyy` | Required per cheque; **not in the past** | +| 28 | `pel_asf_poso` | Insured value | **The client always sends a single space `" "`** — it has no insurance input | +| 29 | `pel_user` | `user_code` | | +| 30 | `pel_ref_no` | "Reference No" | Up to 30 chars; printed on the voucher, searchable, trackable | +| 31 | `pel_insert_flag` | `"1"` = issue now ("Εκτύπωση ΣΥ.ΔΕ.ΤΑ." ticked), `"0"` = pending | We send `"0"` | +| 32 | `pel_paral_code` | Saved recipient's code, if picked from the address book | | +| 33 | `pel_retur_code` | Return-to party's code (special handling only) | See below | + +**Envelope or parcel (mandatory).** The client makes the user choose `Φάκελος` (envelope) +or `Δέμα` (parcel) (`Δεν Εχει Επιλεγεί Είδος`), and encodes it **inside +`pel_paral_sxolia`**: the remarks right-aligned in 99 characters, then `"1"` (envelope) or +`"2"` (parcel) — 100 characters total (`Sydeta.cs:1530`): + +```csharp +pel_paral_sxolia = $"{remarks.Trim(),99}" + "2"; // parcel +``` + +(Only `PELVGNEW` does this; `PELVGUP` and `PELVGINNEW` send the remarks plain.) + +**Surcharges go in fixed slots**, not in order: special handling is always `pel_sur_1`, set +time always `pel_sur_2`, Saturday always `pel_sur_3`; PostBox (`917`) takes `pel_sur_1`. +The client's surcharges: + +| Code | Surcharge | Slot | +|---|---|---| +| `002` | ΕΙΔΙΚΗ ΔΙΑΧΕΙΡΙΣΗ (special handling) | `pel_sur_1` | +| `003` | ΠΡΟΚΑΘΟΡΙΣΜΕΝΗ ΩΡΑ (set delivery time) | `pel_sur_2` | +| `004` | ΕΠΙΔΟΣΗ ΣΑΒΒΑΤΟΥ (Saturday delivery) | `pel_sur_3` | +| `917` | ΕΠΙΔΟΣΗ POST BOX (PostBox delivery) | `pel_sur_1` | + +**Special handling (`002`) and the return-to party.** Ticking special handling sets a +return-to party (`pel_retur_code`), defaulting to the sender; multi-sender accounts can +pick another sub-sender. When ELTA then returns a **return voucher** (`return_vg`), the +client prints it (B6). + +**Business rules the client enforces** (all before calling ELTA): + +- name, address, postcode, service required; at least one phone; pieces 1–20; weight > 0; +- COD is **cash or cheques, never both** (`Δεν Επιτρέπεται Αντικαταβολή Μετρητά Και Επιταγή`); +- each cheque needs a due date, not in the past; +- **PostBox**: not with special handling (`Δεν Επιτρέπεται Post Box Με ειδική Διαχείρηση`), + not with COD (`Δεν Επιτρέπεται Post Box Με Αντικαταβολή`), and needs a 10-digit mobile + starting `69` (`Δεν Επιτρέπεται Post Box Χωρίς Κινητό Τηλέφωνο` / `...Λάθος Κινητό Τηλέφωνο`); +- envelope or parcel must be chosen. + +**Outputs** (same set from `PELVG01NEW1`, plus stations/service there): + +| Out | | +|---|---| +| `vg_code` | The voucher number, e.g. `NZ000987368GR` (empty when pending) | +| `vg_child_no[]` | One number per extra parcel of a multi-parcel send (up to 149) | +| `ocr_line` | OCR line, e.g. `>14260009873682< 17004> 1317759< 25>` — printed at the foot of the A4 payment stub; characters 2–14 are the 13-digit reference printed on the voucher | +| `return_vg`, `r_ocr_line` | Return voucher number and its OCR line (special handling) | +| `epitagh_vg`, `e_ocr_line` | Cheque-return voucher number and its OCR line (COD by cheque) | +| `date_time` | Issue time, `yyyyMMddHHmm` (Greek time). The client picks the report by it (≥ `202410` → current reports) | + +`PELVGNEW` does **not** return the pending voucher's id (`pel_vg_id`); find it with +`PELPARALVGNEW1` (match `pel_ref_no`, empty `pel_paral_vg`, highest id). + +### `PELVG01NEW1` — issue (and re-print) +In: `pel_id` (= `pel_vg_id`, declared `integer`), `sender_station` (= `user_station`). +Out: `st_title`, `return_vg`, `epitagh_vg`, `vg_code`, `vg_child_no[]`, `ocr_line`, +`r_ocr_line`, `e_ocr_line`, `date_time`, `rec_station`, `rec_station_t` (destination +station), `rec_srv`, `rec_srv_t` (the service ELTA settled on, e.g. `201` `ΠΟΛΗ ΠΟΛΗ - ΠΠ`). + +### `PELVGUP` — edit a pending voucher +In: `pel_id`, then the same fields as `PELVGNEW` 1–30 and `pel_paral_code` (no +`pel_insert_flag`, no `pel_retur_code`; remarks sent plain). Out: `st_title`. + +### `PELVGINNEW` — bulk insert (pending) +Used by the file/Excel imports. In: `pel_code` (sender), `user_code`, `paral_title`, +`paral_adress`, `paral_area`, `paral_tk`, `paral_thl1`, `paral_thl2`, `paral_tem` +(pieces), `paral_baros`, `paral_sxolia`, `paral_ant_m` (COD cash), `paral_ant_e` (COD +cheque), `paral_ant_date` (cheque due date), `paral_da` (always `""`), `paral_ref`, +`paral_sur_1`…`3`, `retour_code`. Out: `st_title`. No service, no envelope/parcel flag, +no dimensions — ELTA works them out. + +### `PELVGDEL` — delete a pending voucher +In: `pel_vg_id` (the pending id, not the voucher number). Out: `st_title`. The client +only offers it for rows without a voucher number. + +### `PELPARALVGNEW1` — list pending vouchers +In: `pel_code`, `pel_user_code`, `flag_1` (`"1"` = "Εμφάνιση Όλων": include issued ones), +`flag_2` (`"1"` = "Όλοι Οι Χρήστες": all the account's users), `in_id` (cursor: last +`pel_vg_id`, `"0"` first). Out: `st_title`, `vg_rec[]` (100/page), `vg_rec_counter`. + +Row fields: `pel_vg_id`, `pel_apost_code`, `pel_paral_vg` (voucher number; empty = +pending), `pel_paral_code`, `pel_paral_name`, `pel_paral_address`, `pel_paral_area`, +`pel_paral_tk`, `pel_paral_thl_1`, `pel_paral_thl_2`, `pel_service`, `pel_baros`, +`pel_baros_xyz`, `pel_x`, `pel_y`, `pel_z`, `pel_temaxia`, `pel_paral_sxolia`, +`pel_ant_poso`, `pel_ant_poso1`…`4`, `pel_ant_date1`…`4`, `pel_asf_poso`, `pel_ref_no`, +`pel_sur_1`…`3`, `pel_retour`. + +## A6. Tracking and search + +### `PELTTNEW01` — track one voucher +In: `web_vg` — **a voucher number or our reference number** (the client's field is labelled +`ΣΥ.Δ.ΕΛ.ΤΑ./Reference No`), `pel_code`. + +Out: `st_title`, `web_status[]` (up to 50 checkpoints), `web_status_counter`, `pel_rec`. + +Checkpoint: `web_date_time` (`yyyyMMddHHmmss`, Greek time), `web_station`, +`web_status_name` (e.g. `ΔΗΜΙΟΥΡΓΙΑ ΣΥ.ΔΕ.ΤΑ. ΑΠΟ ΠΕΛΑΤΗ`, in unaccented capitals), +`web_sxolia` (e.g. `PEL CLIENT`). Empty rows pad the array; skip rows without a date. + +`pel_rec` (the voucher record): + +| Field | Meaning | +|---|---| +| `a_vg_3` | The voucher number | +| `a_vg_2` | Its **return** voucher — verified: a special-handling voucher's `return_vg` came back here | +| `a_vg_1` | Its **cheque** voucher (by elimination; the client's field labels suggested the opposite) | +| `a_ref` | Our reference | +| `a_rec_title`, `a_rec_address`, `a_rec_area`, `a_rec_postal`, `a_rec_tel_1`, `a_rec_tel_2` | Recipient | +| `a_rec_station`, `a_rec_station_t` | Destination station | +| `a_services` | Service (code/text) | +| `a_weight` (decimal), `a_no_of_packages` | Weight, pieces | +| `a_antik` (decimal), `a_antik_text` | COD amount and text | +| `a_antik1` (decimal), `a_antik_text1` | **Remittance** ("Απόδοση") — the COD paid back to the merchant | +| `a_sender_date` | Date sent | +| `a_rec_name` | **Delivered to** — the name of whoever received it | +| `a_rec_date_time` | **Delivered at** — blank until delivered | +| `a_apost`, `a_sxolia` | Sender, remarks | + +### `PELMANIF2` — vouchers in a date range, by status ("Πολλαπλή Αναζήτηση") +In: `pel_code`, `date_1`, `date_2` (`dd/MM/yyyy`), `paral_code` (optional recipient), +`status_flag`, `in_id` (cursor: last `pel_col_id`). + +| `status_flag` | | +|---|---| +| `0` | All (`Ολα`) | +| `1` | Delivered (`Παραδομένα`) | +| `2` | Undelivered (`Απαραδοτα`) | +| `3` | To be returned (`Προς Επιστροφή`) | + +Row: `pel_col_1` voucher · `pel_col_2` reference · `pel_col_3` recipient · `pel_col_4` +postcode · `pel_col_5` station · `pel_col_6` last status · `pel_col_7` remarks/date · +`pel_col_8` COD · `pel_col_id` cursor. Only main vouchers are listed. + +### `PELMANIFNEW` — index / manifest ("Ευρετήριο") +In: `pel_code`, `date_1`, `date_2`, `paral_code`, `in_id` (cursor: last `pel_col_15`). +Out: `ag_pel_rec[]`, `ag_pel_counter`, **`spel_baros`** (total weight of the page, decimal), +**`spel_temaxia`** (total pieces of the page). + +Row: `pel_col_1` voucher · `2` weight · `3` pieces · `4` recipient · `5` address · +`6` postcode · `7` station · `8` sender · `9` reference · `10` COD · `11` **cheque +voucher** · `12` **return voucher** · `13` + `14` the two phones · `15` cursor. + +## A7. Address book + +| Operation | In | Out | +|---|---|---| +| `PELPARALIN` | `pel_code`, `paral_code`, `paral_title`, `paral_adress`, `paral_area`, `paral_tk`, `paral_thl1`, `paral_thl2` | `st_title` | +| `PELPARALUP` | same as `PELPARALIN` | `st_title` | +| `PELPARALSE` | `pel_code`, `paral_code` | the recipient's fields | +| `PELPARALDE` | `pel_code`, `paral_code` | `st_title` | +| `PELPARALDE1` | `pel_code`, `paral_code_1`, `paral_code_2` (a code range) | `st_title` | +| `PELPARALCE` | `pel_code`, `paral_code`, `paral_tk`, `tk_flag`, `pel_flag` | `st_tk` (`"1"` = bad postcode), `st_code` (`"1"` = code already exists) | + +## A8. Client-side configuration files (for reference) + +| File | Content | +|---|---| +| `ip.txt` | `;` — web-service host (prefixed with `https://`) and update FTP host | +| `proxy.txt` | `ip;port;user;pass` | +| `printer.txt` | `print_on_create(0/1);printer name;paper size` — `1` = A4, `2` = label (A6) | +| `paral.txt`, `awb.txt` | Excel column letters for the recipient (7) and voucher (16) imports | + +## A9. Excel import (voucher columns) + +Recipient name, address, area, postcode, phone, mobile, pieces, weight, remarks, COD cash, +COD cheque, cheque due date, reference, surcharge 1–3 — each mapped to a column letter +(defaults `A`…`P`). Rows are validated (postcode via `PELTK1`, PostBox via `PELTKBOX`, +pieces ≤ 20, …), invalid ones shown red and skipped; valid ones go through `PELVGINNEW` +as pending vouchers, issued later from batch processing. + +--- + +# Part B — Printing + +## B1. When the client prints + +- **On creation**, if "Εκτύπωση ΣΥ.ΔΕ.ΤΑ." is ticked (default from `printer.txt`): it sends + `pel_insert_flag = "1"` and prints straight away. +- **From batch processing** ("Εκτύπωση Επιλεγμένων" / "Εκτύπωση Όλων"): issues each voucher + with `PELVG01NEW1` and prints it. + +Each print job prints, in order (`Sydeta.cs:1646`, `epexergasia.cs`): + +1. the **main voucher** (`print_vg`); +2. one label per **extra parcel**, `002/00n`, `003/00n`, … (`print_child`) — printing the + main voucher always prints every parcel; there is no way to print one extra parcel alone; +3. the **return voucher**, if ELTA returned `return_vg` (B6); +4. the **cheque-return voucher**, if ELTA returned `epitagh_vg` (B7). + +## B2. Paper and report selection + +| Paper (`printer.txt`) | Page (render DeviceInfo) | Main voucher | Extra parcel | +|---|---|---|---| +| `1` A4 | 21 × 29.7 cm, no margins | `sydetaE.rdlc` | `sydetaE1.rdlc` (separate, smaller report) | +| `2` label | **10.4 × 14.8 cm** (not ISO A6's 10.5), no margins | `SydetaLabelE.rdlc` | `SydetaLabelE.rdlc` (same report) | + +Vouchers issued before October 2024 (`date_time` < `202410`) use the older reports +(`sydeta`, `sydeta1`, `SydetaLabel1`). `sydeta_R`, `sydeta1_R`, `SydetaLabel2` are only +on-screen previews. Rendering is EMF at the page size, drawn to the whole page, sent to the +configured printer without a dialog (a print dialog only if no printer is configured). + +## B3. The print data — every field + +The reports read one dataset row (`DataSet1.print_fields`). How the client fills it for a +**main voucher** (`Sydeta.cs::print_vg`, `epexergasia.cs::print_vg`): + +**Sender (`sender_1`…`5`)** + +| | | +|---|---| +| `sender_1` | `"Κωδικός:" + sender code` | +| `sender_2`, `sender_3` | Sender name, split at 40 characters (`sender_3` = the next 40, else `""`) | +| `sender_4` | Sender address (first 40 characters) | +| `sender_5` | `"TK:" + postcode + " " + area + " ΤΗΛ:" + phone`, cut at 40 | + +Sender = the account (single-sender) or the chosen sub-sender. + +**Recipient (`rec_1`…`5`)** + +| | | +|---|---| +| `rec_1`, `rec_2` | Recipient name, split at 40 (`rec_2` = the rest, else `""`) | +| `rec_3` | Address (first 40) | +| `rec_4` | `"TK:" + postcode + " " + area` | +| `rec_5` | `"ΤΗΛ: " + phone + " " + mobile` | + +**Voucher and routing** + +| Field | Value | +|---|---| +| `sydeta` | Voucher number, e.g. `NZ000987368GR` | +| `barcode` | `"*" + voucher + "*"` — printed in a **Code 39 barcode font** (the asterisks are Code 39 start/stop) | +| `barcode_2` | `ocr_line` characters 2–14 (13 digits), e.g. `1426000987368` | +| `date` | A4: `dd/MM/yyyy HH:mm`; label: `dd/MM/yyyy` | +| `time` | Label only: `HH:mm` | +| `service`, `service_title` | Service code and title, e.g. `201` / `ΠΟΛΗ ΠΟΛΗ - ΠΠ` | +| `station_apo` | Deposit station = the user's station (`Γρ.Κατάθεσης`) | +| `station_pros`, `station_pros_title` | Destination station (`Γρ. Επίδοσης`), e.g. `94580` / `ΙΩΑΝΝΙΝΑ - ΠΡΑΚΤΟΡΕΙΟ` | +| `xreosi` | `ΧΡΕΩΣΗ ΑΠΟΣΤΟΛΕΑ ΠΙΣΤΩΣΗ` (charged to sender, on credit) | +| `siimvasi` | `131775-9` (fixed; the ELTA "Ταχυπληρωμή" account number) | +| `copy` | Empty on a main voucher (see extra parcels / return voucher) | + +**Parcel** + +| Field | Value | +|---|---| +| `baros` | Weight as entered | +| `ogos_baros` | Volumetric weight (A4) | +| `ogos_1` | `"XxYxZ"` (A4) | +| `ogos_2` | `"XxYxZ = "` (label) | +| `ogos_3` | `* ΠΡΟΣΟΧΗ PostBox *` for PostBox, else empty | +| `temaxia` | 1 piece: the count as entered (`1`); several: `"001/" + count` (e.g. `001/003`) | +| `polaplo` | `* ΠΟΛΛΑΠΛΗ ΑΠΟΣΤΟΛΗ *` when more than one piece | +| `periexomeno` | The Reference No (`pel_ref_no`) — printed in the REFERENCE box | +| `sxolia_1`…`3` | Remarks in **27-character** lines (1st 27, next 27, the rest) — the plain remarks, not the padded/flagged value | + +**Cash on delivery** (`num6` = cash + all cheques) + +| Field | When | Value | +|---|---|---| +| `antik_minima` | COD | `* ΠΡΟΣΟΧΗ ΑΝΤΙΚΑΤΑΒΟΛΗ *` | +| `apodiksi` | COD | `* Απόδειξη Είσπραξης *` (the entry screen misspells it `Είσπαξης`; batch printing spells it right) | +| `antik_1` | COD | `ΑΝΤΙΚΑΤΑΒΟΛΗ `; PostBox: `* ΠΡΟΣΟΧΗ PostBox *` | +| `antik_2` | COD | `* ΑΝΑΛΥΣΗ *` | +| `antik_3` | cash | ` MΕΤΡΗΤΑ` (the "M" is a Latin M) | +| `antik_3`…`6` | cheques, A4 | ` € ΕΠΙΤΑΓΗ ` per cheque | +| `antik_3`…`6` | cheques, label | ` ΕΠ/ΓΗ ` per cheque | +| `antik_poso` | always | the total if paid in cash, else `0.00` (cheques and no COD) | +| `antik_ocr` | always | `ocr_line` — printed at the foot of the A4 payment stub | + +**Surcharges (`sur_1`…`3`)** — from the codes, in this layout: + +| Codes | `sur_1` | `sur_2` | `sur_3` | +|---|---|---|---| +| 002 | 002 ΕΙΔΙΚΗ ΔΙΑΧΕΙΡΗΣΗ | | | +| 002 + 003 | 002 … | 003 ΠΡΟΚΑΘΟΡΙΣΜΕΝΗ ΩΡΑ | | +| 002 + 003 + 004 | 002 … | 003 … | 004 ΕΠΙΔΟΣΗ ΣΑΒΒΑΤΟΥ | +| 002 + 004 | 002 … | 004 ΕΠΙΔΟΣΗ ΣΑΒΒΑΤΟΥ | | +| 003 | | 003 … | | +| 003 + 004 | | 003 … | 004 … (entry screen) / `sur_1` = 004 (batch) | +| 004 | | 004 … (entry screen) / `sur_1` = 004 (batch) | | +| 917 (PostBox) | `* ΠΡΟΣΟΧΗ PostBox *` | (003/004 as above) | | + +(The entry screen and batch printing place 004 differently when 002 is absent — a client +inconsistency; `sur_4` exists in the A4 report but is never filled.) + +Fields in the dataset that no code fills: `service_thirida`, `axia`, `sur_4`, `antik_7`. + +## B4. Extra parcel labels (`print_child`) + +For each `vg_child_no` (k = 2, 3, …; n = pieces): + +| Field | Value | +|---|---| +| `sydeta`, `barcode` | The **parcel's own** number / `*number*` | +| `temaxia` | Label: `"00k/00n"` (e.g. `002/003`); A4: `n` | +| `periexomeno` | A4 only: `"00k/00n"` — printed large in the child report | +| `polaplo` | Label: `ΠΟΛΛΑΠΛΗ ΑΠΟΣΤΟΛΗ - MASTER :
` | +| `copy` | Label: `ΠΟΛΛΑΠΛH`; A4: `"*" + main voucher + "*"` (under `ΜASTER ΣΥΔΕΤΑ`) | +| `antik_minima`, `antik_1` | COD: `* ΠΡΟΣΟΧΗ ΑΝΤΙΚΑΤΑΒΟΛΗ *` — **no amount** (collected on the main voucher) | +| sender, recipient, `date`, `time`, `service`, `service_title`, `baros`, stations, `sxolia_1`…`3` | As on the main voucher | +| Not set | `barcode_2`, `xreosi`, `siimvasi`, `sur_*`, `ogos_*`, other `antik_*`, reference (label) | + +## B5. What each report prints + +### A4 main voucher — `sydetaE.rdlc` + +One A4 page, three bands separated by cut lines, each with a side strip naming the copy: + +| Band | Copies (side strips) | Contents | +|---|---|---| +| 1 (top) | `1. ΑΠΟΣΤΟΛΕΑΣ / SHIPPER`, `3. ΑΡΧΕΙΟ / ΓΡΑΦΕΙΟ ΚΑΤΑΘΕΣΗΣ` | Full voucher: logo, ELTA details, title, barcode, voucher, deposit/destination stations, weight, volumetric, pieces, service, sender, recipient, charge line, surcharges, reference, remarks, COD block, signature boxes, terms | +| 2 | `6. ΠΑΡΑΛΗΠΤΗΣ / CONSIGNEE`, `5. ΑΡΧΕΙΟ / ΓΡΑΦΕΙΟ ΕΠΙΔΟΣΗΣ` | Same voucher again, with the sender's signature box, print time, `copy`, `antik_minima`, `apodiksi` | +| 3 (payment stub) | `2. - 4. ΛΟΓΙΣΤΗΡΙΟ` | "ΤΑΧΥΠΛΗΡΩΜΗ ΕΙΣΠΡΑΞΗ / ΜΕΤΑΒΙΒΑΣΗ": voucher + barcode, stations, weight, pieces, service, charge, sender (code + name), recipient (name, address, postcode), surcharges, remarks, signature boxes, COD breakdown, **ΠΟΣΟ** (`antik_poso`), date stamp, fees, "Η-αριθμός", "Αρ. Λογ/κής Απόδοσης", and the OCR line below "ΜΗ ΣΗΜΕΙΩΝΕΤΕ ΚΑΤΩ ΑΠΟ ΑΥΤΗ ΤΗ ΓΡΑΜΜΗ" | + +Fields used: `antik_1`–`7`, `antik_minima`, `antik_ocr`, `antik_poso`, `apodiksi`, `barcode`, +`baros`, `copy`, `date`, `ogos_1`, `ogos_3`, `ogos_baros`, `periexomeno`, `rec_1`–`5`, +`sender_1`–`5`, `service`, `service_title`, `station_apo`, `station_pros`, +`station_pros_title`, `sur_1`–`4`, `sxolia_1`–`3`, `sydeta`, `temaxia`. + +Fixed texts (verbatim, typos included): + +- `ΣΥΝΟΔΕΥΤΙΚΟ ΔΕΛΤΙΟ ΤΑΧΥΜΕΤΑΦΟΡΑΣ` +- `ΥΠΗΡΕΣΙΑ :`, `Ογκ/κο Βάρος` +- `ΧΡΕΩΣΗ ΑΠΟΣΤΟΛΕΑ ΤΡ.ΠΛΗΡ: ΠΙΣΤΩΣΗ` (copies), `ΧΡ. ΑΠΟΣΤ: ΠΙΣΤΩΣΗ` (stub) +- `Συν.Χρέωσης (€):` / `Συν.Χρέωσης. (€):` / `Συν.Χρ. (€):` +- `Πρόσθετες Υπηρεσίες`, `* ΕΠΙΒΑΡΥΝΣΕΙΣ *` +- `* REFERENCE No *` / `* REFERENCE No*` +- `* ΠΑΡΑΤΗΡΗΣΕΙΣ *` +- `ΓΙΑ ΤΗΝ ΠΑΡΑΛΑΒΗ`, `ΟΝΟΜΑ/ΥΠΟΓΡΑΦΗ` +- `ΥΠΟΓΡΑΦΗ ΑΠΟΣΤΟΛΕΑ`, `ΟΝΟΜΑ/ΥΠΟΓΡΑΦΗ ΠΑΡΑΛΗΠΤΗ` +- `Ημερομηνία - Ωρα Εκτύπωσης :`, `Ημ/νία:`, `Ώρα:` +- `Π Ο Σ Ο` +- `Έλαβα γνώση των όρων που αναγράφονται στο αντίγραφο 1 και 6 και τους αποδέχομαι + ανεπιφύλακτα` (and a variant ending `...αντίγραφο 1 και τους αποδέχομαι ανεπιφύλακτα`) +- `ΕΕΤΤ ΑΜ 99-150 Γενική Αδεια Ταχ/κων Υπηρεσιών` + +Images used, with what they contain: + +| Image | Where | Content | +|---|---|---| +| `elta`, `elta1` | Band 1/2 top-left | ELTA Courier logo | +| `Πλήρηστοιχεία_red1`, `_red2`, `_black` | Next to the logo; stub | **ELTA company details** (see B8) | +| `Point2_EETTAM_August2024` | Band 1 | `ΕΕΤΤ ΑΜ: 99-150 Γενική Άδεια Ταχ/κων Υπηρεσιών` | +| `Point4_CompanynameEETTAM_August2024` | Band 2 | `ΕΛΛΗΝΙΚΑ ΤΑΧΥΔΡΟΜΕΙΑ Α.Ε. ΕΕΤΤ ΑΜ: 99-150 Γενική Άδεια Ταχ/κων Υπηρεσιών` | +| `oroi` | Band 1, vertical | `Ισχύουν οι Γενικοί Οροι Παραχής Υπηρεσιών οι οποίοι βρίσκονται αναρτημένοι στο www.elta-courier.gr και είναι διαθέσιμοι σε ολα τα καταστήματα της εταιρίας.` ("Παραχής", "ολα": ELTA's own spelling, same as the label) | +| `ID1__shipper_ec` | Band 1 side | `1.ΑΠΟΣΤΟΛΕΑΣ / SHIPPER` | +| `ID3__file_ec` | Band 1 side | `3. ΑΡΧΕΙΟ / ΓΡΑΦΕΙΟ ΚΑΤΑΘΕΣΗΣ` | +| `ID6__consignee_ec` | Band 2 side | `6. ΠΑΡΑΛΗΠΤΗΣ / CONSIGNEE` + `ΕΕΤΤ ΑΜ:01-200 Γενική Άδεια Ταχ/κών Υπηρεσιών` | +| `ID5__file_store_elta_courier` | Band 2 side | `5. ΑΡΧΕΙΟ / ΓΡΑΦΕΙΟ ΕΠΙΔΟΣΗΣ` | +| `ID2_4_logistirio` | Stub side | `2. - 4. ΛΟΓΙΣΤΗΡΙΟ` | +| `elta_taxyplirwmi_eispraksi` | Stub header | `ΤΑΧΥΠΛΗΡΩΜΗ ΕΙΣΠΡΑΞΗ / ΜΕΤΑΒΙΒΑΣΗ Ο. Αριθμός Λογ/μού Ταχυπληρωμής 131775-9` | +| `elta_chromologiko_simantro` | Stub | ELTA Ταχυπληρωμή logo + `Χρονολογικό Σήμαντρο` (date-stamp box) | +| `elta_teli` | Stub | `Τέλη` (fees) | +| `elta_h_arithmos` | Stub | `Η - αριθμός` | +| `elta_ar__logiostikis_apodosis` | Stub | `Αρ. Λογ/κής Απόδοσης` | +| `Point5_ELTACourier_ΑποστολήμαςΕσείς_September2024` | Stub, vertical | ELTA "Hellenic Post" logo + `Αποστολή μας εσείς!` | +| `mhn_shmeivnete` | Foot | `ΜΗ ΣΗΜΕΙΩΝΕΤΕ ΚΑΤΩ ΑΠΟ ΑΥΤΗ ΤΗ ΓΡΑΜΜΗ` | + +### A4 extra parcel — `sydetaE1.rdlc` + +A single block: logo (`eltared`) + company details (`Πλήρηστοιχεία_red1`), `ΕΕΤΤ ΑΜ 99-150 +Γενική Αδεια Ταχ/κων Υπηρεσιών`, `ΣΥΝΟΔΕΥΤΙΚΟ ΔΕΛΤΙΟ ΤΑΧΥΜΕΤΑΦΟΡΑΣ`, barcode + parcel number, +`Ημερομηνία - Ωρα Εκτύπωσης :` + date, deposit station / weight / `Ογκ/κο Βάρος` / pieces, +`ΥΠΗΡΕΣΙΑ :` + service, destination station, sender (5 lines), recipient (5 lines), and a +panel with `** ΠΟΛΛΑΠΛΗ ΑΠΟΣΤΟΛΗ **`, the piece (`002/003`, large), the COD warning, +`ΜASTER ΣΥΔΕΤΑ` and the master voucher. No surcharges, reference, remarks, charge line, +COD amounts or stub. + +### Label (10.4 × 14.8 cm) — `SydetaLabelE.rdlc` + +Top: logo (`elta_logoblack`), company details (`Πλήρηστοιχεία_black1`), a `ΥΠΗΡΕΣΙΑ:` box +(service + title), the EETT box (`Point2_EETTAM_August2024`), date and time, +`ΣΥΝΟΔΕΥΤΙΚΟ ΔΕΛΤΙΟ ΤΑΧΥΜΕΤΑΦΟΡΑΣ`, `copy`. Then `Γρ. Επίδοσης :` + destination station; +a row of charge (`xreosi`) / OCR reference (`barcode_2`) / `siimvasi`; `Γρ.Κατάθεσης:`, +`ΒΑΡΟΣ(Kgr)`, `ΟΓΚΟΜΕΤΡΙΚΟ ΒΑΡΟΣ(Kgr)` (`ogos_2`), `Τεμάχια`; the sender (`ΑΠΟΣΤΟΛΕΑΣ`, +5 lines) next to **`ΑΙΤΙΑ ΕΠΙΣΤΡΟΦΗΣ`** (return reasons with tick boxes: `Άγνωστος`, +`Ελλειπή Δ/νση`, `Απαράδεκτο`, `Άλλαξε Δ/νση`, `Αζήτητο`); the recipient (`Π Α Ρ Α Λ Η Π Τ Η Σ`, +5 lines) next to the COD column (`antik_1`…`7`); `REFERENCE` (`periexomeno`) and +`* ΠΑΡΑΤΗΡΗΣΕΙΣ *` (`sxolia_1`, `sxolia_2` — only two lines on the label) next to +`* ΕΠΙΒΑΡΥΝΣΕΙΣ *` (`sur_1`…`3`); the `polaplo` line; the terms (`Ισχύουν οι Γενικοί Οροι +Παραχής Υπηρεσιών οι οποίοι βρίσκονται αναρτημένοι στο www.elta-courier.gr` / `και είναι +διαθέσιμοι σε ολα τα καταστήματα της εταιρίας.` — "Παραχής" is ELTA's typo); the +`antik_1` banner; the barcode; the voucher number (`sydeta`). + +## B6. Return voucher ("RETOUR") + +Printed when `return_vg` is not empty (special handling with a return-to party): + +| Field | Value | +|---|---| +| `copy` | `RETOUR` | +| `rec_1`…`5` (**recipient = return-to party**) | `"Κωδικός:" + code`, name (split at 40), address, `"TK:… … ΤΗΛ:…"` | +| `sender_1`…`5` (**sender = our recipient**) | name (split at 40), address, `"TK:" + postcode + " " + area`, `"ΤΗΛ: " + phones` | +| `sydeta`, `barcode` | `return_vg` | +| `barcode_2` | `r_ocr_line` characters 2–14 | +| `service`, `service_title` | `461` `RETOUR ΕΝΤΟΣ ΠΟΛΗΣ` if the original service starts with `1`, else `462` `RETOUR ΠΟΛΗ ΠΟΛΗ` | +| `xreosi` | `ΧΡΕΩΣΗ ΠΑΡΑΛΗΠΤΗ ΠΙΣΤΩΣΗ` (charged to the recipient) | +| `siimvasi` | `131775-9` | +| `baros`, `temaxia` | `0.100`, `1` | +| `station_apo` / `station_pros` | the original destination station / the return-to party's station | +| `sxolia_1`…`3` | `"ΣΥΔΕΤΑ
Χρέωση Πελάτη "` in 27-char lines | +| `antik_poso` / `antik_ocr` | `0.00` / `r_ocr_line` | + +## B7. Cheque-return voucher + +Printed when `epitagh_vg` is not empty (COD by cheque) — carries the cheques back: + +| Field | Value | +|---|---| +| `copy` | empty | +| `rec_*` (**recipient = our sender**) | `"Κωδικός:" + sender code`, sender name, address, TK/area/phone line | +| `sender_*` (**sender = our recipient**) | as in B6 | +| `sydeta`, `barcode`, `barcode_2` | `epitagh_vg`, `*epitagh_vg*`, `e_ocr_line` characters 2–14 | +| `service`, `service_title` | `350` `ΕΠΙΣΤΡΟΦΗ ΑΞΙΟΓΡΑΦΩΝ` | +| `xreosi` | `ΧΡΕΩΣΗ ΠΑΡΑΛΗΠΤΗ ΠΙΣΤΩΣΗ` | +| `siimvasi`, `baros`, `temaxia` | `131775-9`, `0.100`, `1` | +| `station_apo` / `station_pros` | the original destination station / the user's station | +| `sxolia_*` | `"ΣΥΔΕΤΑ
Χρέωση Πελάτη "` | +| `antik_poso` / `antik_ocr` | `0.00` / `e_ocr_line` | + +## B8. ELTA company details (as printed, from ELTA's current images) + +``` +ΕΛΛΗΝΙΚΑ ΤΑΧΥΔΡΟΜΕΙΑ Α.Ε. +Έδρα: Λεωφ. Ιωνίας 200 & Ιακωβάτων 61, +111 44 Αθήνα +Α.Φ.Μ.: 094026421 | Δ.Ο.Υ.: ΚΕ.ΦΟ.Δ.Ε. ΑΤΤΙΚΗΣ +Τ. 210-6073000 | Ε. info@elta-courier.gr +www.elta-courier.gr +Γ.Ε.ΜΗ: 001092101000 +``` + +EETT licence: `ΕΕΤΤ ΑΜ: 99-150 Γενική Άδεια Ταχ/κων Υπηρεσιών` (the older `01-200` still +appears on the consignee copy strip and the legacy reports, whose company block reads +`ΤΑΧΥΜΕΤΑΦΟΡΕΣ ΕΛΤΑ Α.Ε., Λ.Μεσογείων 395, Αγία Παρασκευή, 153 43, ΤΗΛ:210 6073000 +FAX:2106073100, ΑΦΜ: 099759170 ΔΟΥ ΦΑΕ ΑΘΗΝΩΝ, Ε.Ε.Τ.Τ. ΑΜ 01-200` — not current). + +## B9. Other printouts (reports lists) + +| Report | Screen | Columns | +|---|---|---| +| `Report1` (landscape) | Index, simple | ΣΥ.ΔΕ.ΤΑ., ΒΑΡΟΣ, ΤΕΜΑΧΙΑ, ΠΑΡΑΛΗΠΤΗΣ, ΔΙΕΥΘΥΝΣΗ, Τ.Κ., ΣΤΑΘΜΟΣ, ΑΠΟΣΤΟΛΕΑΣ, REFERENCE No; title `ΚΑΤΑΣΤΑΣΗ ΣΥ.ΔΕ.ΤΑ.` + date range; totals row `ΣΥΝΟΛΑ` (weight, pieces) | +| `Report3` (landscape) | Index, extended | the above + ΤΗΛΕΦΩΝΑ, ΑΝΤ/ΛΗ, ΣΥΔΕΤΑ ΕΠΙΤΑΓΗΣ, ΣΥΔΕΤΑ ΕΠΙΣΤΡΟΦΙΚΟΥ | +| `Report2` (landscape) | Multiple search | ΣΥ.ΔΕ.ΤΑ., REFERENCE, ΠΑΡΑΛΗΠΤΗΣ, Τ.Κ., ΣΤΑΘΜΟΣ, ΑΝΤ/ΒΟΛΗ, ΤΕΛΕΥΤΑΙΟ STATUS, ΣΧΟΛΙΑ | + +--- + +# Part C — Where our integration differs (as of 0.29.3) + +Rows marked **Fixed** are handled since 0.31.0 (see CHANGELOG); the "Ours" column describes the fixed behaviour. + +## Verified against ELTA's test account (2026-09-30) + +All with generic test data (`TEST RECIPIENT`, `TEST ADDRESS 1`, `10431`, `2100000000`, +references `TEST-…`); pending vouchers were deleted afterwards. One issued voucher remains +on the shared account: `NZ000987460GR` (+ return voucher `NZ000987473GR`). + +| Check | Result | +|---|---| +| HTTPS | Works on `https://clients.elta-courier.gr` (443); fails on the old IP and on port 9003 (see A1) | +| Envelope/parcel flag | Accepted. ELTA trims the padding and **keeps the flag as the last character of the remarks** (`TEST REMARK2`, also in tracking `a_sxolia`). Whether ELTA also reads it as the parcel type isn't visible through the API | +| Surcharge slots | Stored exactly in the slot sent (`004` in slot 1 stays `004\|000\|000`); ELTA does not normalize. Tracking (`a_services`) shows only the service, never surcharges, so their effect can't be read back. ELTA's own client only reads Saturday from slot 3 (B3), so `004` in slot 1 would not print as Saturday there | +| Blank service | Accepted, but ELTA stores **`201` ΠΟΛΗ ΠΟΛΗ** for 10431, where its own lookup (`PELTKNEW`) gives **`101` ΕΝΤΟΣ ΠΟΛΗΣ** for the test station — a blank service can land on a different service than the client would send. Explicit `101`/`201` are honoured | +| Localities | Common: 45500 Ιωάννινα has 190 localities (170 hard-to-reach → `231`), 20100 Κόρινθος 41 (16), 72200 Χίος 56 (31); islands get `211` ΠΟΛΗ ΠΟΛΗ -ΠΠ- ΝΗΣΙ | +| Insurance | `pel_asf_poso = 50.00` is stored; effect not visible | +| No phones / 21 pieces | Both accepted at creation (the limits are the client's); not tested at issue | +| Remarks > 90 | 95 characters accepted and stored in full (90 is the client's limit) | +| Special handling + return-to | Issuing returned a **return voucher** (`return_vg` + `r_ocr_line`); tracking lists it in `a_vg_2` | +| Tracking by reference | `PELTTNEW01` with our reference (`00000007`) returns the voucher | +| Delivery / remittance fields | Present in `pel_rec` (`a_rec_name`, `a_rec_date_time`, `a_antik1`, `a_antik_text1`); empty until delivery | +| PostBox lookup (`PELTKBOX`) | `10431` → station `10200` ΑΙΟΛΟΥ 100 (Κ.Κ.), service `101`; `45500`, `84100`, `00000` → `st_flag 1` "Το Τ.Κ. Δεν Εχει PostBox" | + +## The differences + +| # | Topic | ELTA client | Ours | Impact | +|---|---|---|---|---| +| 1 | Envelope/parcel | Mandatory; remarks right-aligned in 99 chars + `1`/`2` in `pel_paral_sxolia` | Remarks right-aligned in 99 characters (padded by characters) + `2` | **Fixed** | +| 2 | Surcharge slots | Fixed: `002`→1, `003`→2, `004`→3, `917`→1 | Fixed slots, as the client | **Fixed** | +| 3 | Service | Always resolved first (`PELTKNEW`) and sent | Resolved with `PELTKNEW` (sender station) and sent | **Fixed** (was blank; ELTA then gave `201` where its lookup gives `101`) | +| 4 | Localities | Area = `code/title` of the picked locality; hard-to-reach → service `231` | Locality matched by the address's city (accents/case ignored) → `code/title` + its service; no match → blank service, noted on the shipment | **Fixed** | +| 5 | Phones | At least one required; PostBox needs `69…` mobile | At least one required; digits only, `30`/`0030` dropped, `69…` → mobile field | **Fixed** (PostBox not offered) | +| 6 | Pieces | 1–20 | Refused above 20 | **Fixed** | +| 7 | Insurance | Never sent (`" "`) | We send `pel_asf_poso` | Unverified whether ELTA honours it | +| 8 | PostBox (`917`) | Supported, with rules (no COD, no special handling, mobile) | "PostBox delivery" extra service: `PELTKBOX` routing, `917` in `pel_sur_1`, the client's rules checked, PostBox texts on the label | **Fixed** | +| 9 | Cheque COD | Up to 4 cheques + dates; cheque-return voucher printed | Cash only | Fine for a shop; noted for completeness | +| 10 | Special handling + return | Return-to party (`pel_retur_code`); RETOUR voucher printed | Return-to = our sender code; `return_vg` + `r_ocr_line` stored; RETOUR page printed after the parcels (B6) | **Fixed** | +| 11 | Remarks length | 90 chars | 90 | — | +| 12 | Company details on labels | B8 (Ιωνίας 200, Γ.Ε.ΜΗ) | B8 details on the A4 copies, stub, A4 child and A6 | **Fixed** | +| 13 | `Απόδειξη Είσπραξης` | Correct in batch printing | Correct | **Fixed** | +| 14 | Side copy strips, stub strips, "Αποστολή μας εσείς" | Images (B5) | Approximated / missing | Cosmetic | +| 15 | Tracking by reference | `PELTTNEW01` accepts our reference | We track by voucher only | **Verified** working — could track a voucher whose number we don't have | +| 16 | Delivery details | `a_rec_name`, `a_rec_date_time` | Stored from each tracking poll (`meta.delivered_to` / `delivered_at`); shown on the order page and Carrier Vouchers view | **Fixed** | +| 17 | COD remittance | `a_antik1`, `a_antik_text1` | Stored (`meta.cod_remitted` / `cod_remittance`); shown as "COD paid back" | **Fixed** | +| 18 | Scheme | `https://clients.elta-courier.gr` | `https://clients.elta-courier.gr`, 2 retries on connection errors / 5xx | **Fixed** | diff --git a/resources/logos/elta-logo.png b/resources/logos/elta-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fe5c23e909074790d8b32bb62ab1a9c78aca48c6 GIT binary patch literal 63390 zcmYJacRbbq|2~d`BYW@dSRpHW6(>8gNk&F0S=rmkI<|wd$&RwK*O4tD$_P0|_TJm~ zdCu$o`Tb6Rbh~jok8xj*>weuYQBQQ#NC+7Tv9Pd6G}NK`SXj7KSXdwd0({^nX1tD_ zz<>BQT53?NTlBw=Z6(QASnOCD(1(UTSzB|yKG~kxH~XinGBO&cZAC);S0vsHt z@zFr7VPC}#C7r36F&>%ooPR+UCKbs!|9qV*#+Kzz&+kRR;ah*c*5h7!%taisBZTww zR(A8aqTuLH3L_EA11O}UNpJE3Yfq6qZbr9Sn<~!X>aME@1^RC`B8J z{uF*HMN(2sGt~*HQC8!mwI-{v;m}g?noHc(`tSFYdu5E4Bnzv&xmEME)nO&>Wj5c}`I`T4+s3#B$b z+;Vk0Av;|Thv*xrPHB@Yq-v}uE`ro~F(=liHnfg{9~lQ8ip&OKY0q?-Y+*U~nPT4< zFus;t5&7SCod)RbcxOL3DzG);s_*m=HH6MZ_%ngTrQD~7gk%W$I4M=j%CqRkyVTD_ z1_Q8OfUx0QU5gZzio!2MRAsQ7BhDQ+!B4-^EV4|mHYHbW@fj!BjP2v&LnaTsC9Cqq z#;tD6fCG(nV2)GN^nE^|ryNI|I;p0&4M8A9h9W4%iEZgcaOm-g@$ipq$Aplo)?J&&03M(Ss$gM2A*Jyp%XQOjE$SF`2#9w9~B)Je)TT@G@CT z1TKVj0>pd6yv&U@i6wkgu9pqogqNR5f7!jOUbOfZOpVC*nn=PXX7mx!yI_yK4!L%n zVVk0BzMZ90%8fS1_aXHmJQLWXt5RCDNEq{Yp*HmrSheU85NGQ5e!NPDzN1Bf0==JD zg-;8iluEu_r4CgFH0{OdmsyRlT zB7Izp@^B!HMY-F~rlw&SVvXY`oa)ky3{IE{g`Qwl&#M_6*XF4JnMDn1Tc@B{7d|e( zjl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LC-v!61lVzoeh@b?9J?z@nSxGy#SSOFmq<(iZ8d;Yf^nHEl@*cLD7W^<^ClSXpvFp z_0OkQtI7^FRw=;?9{+v8t+|_mS*SaUB3Bo5U+SnzdsiJ4@*iZm1+Xk7O zI=8^Iap7+pOY9aJ?#HBVa()hZ*4W4SIHXCx=JzK3@mMN!Su^o!CSEG=gAv(UL~6Vp zBqS49+Vtg7t;j=$WUhPB*oQZ=JMun?A ziChnQaWF1@{h?)`x6PG#`)GvUP>gg28B5}0P;YkwG(~ItpFtzxKfL)WU3mt`77ds0 z3=t)0_-=it-~SM#j4ic*H9OXv^a;fi%9iI%p(9dBPhK;!y?J5{33L&C2jcIfz=8mt zE!g2x*kkH+KCg70P>guo{X=yO?+bMKjwzbp^C91^K1-fy48TPmG`+ZEa5M; zZMeFXQ!0ob)a>Y+j+_Q3T_fT~}YP@!`R7_i5%O|5W8_vvO%c%e*in7HV5- zdq5VDSD8&IgPW_Dy{l~T!ZV%{t|fiU%x1p#boCmT6Ed*9{%Y%2UWWMok30xA({%ae zt9rPE#B=vWEY5}fjT>|2H4_V-&0*YCaBR%@H6xuaSUOJ%)^~4~r;QKuJ(5 zk*6Qq*oB@@R9X(Ll()IG;<)86O+N5_aZrr4DeA z_zS6~(-+)SvgC7=*ZmV72PC)&>T|7wIKIISh2knY@(SvHILXSThATI?-}}D0uj8TqyY+ZV!KP>PJTA~;`|58NECs4dYeaN zlX;VvZBcRf%Q=_|3y=NB1QK4BV&Dc+evu~3#EkwnW=`xiDis6`m&LWlm%Y76S}UeP zkHXc%yWm=&Wp`3i^EygdRo6)@pj8OLghACN&)1o8s$|!r5Bbb cfq8rZ^+RWEUkOlLFM*$ynx1O8idE?U06!MhU;qFB literal 0 HcmV?d00001 diff --git a/resources/views/shipping/carriers/elta/label-a4-child.blade.php b/resources/views/shipping/carriers/elta/label-a4-child.blade.php index b3f4159..5b216cc 100644 --- a/resources/views/shipping/carriers/elta/label-a4-child.blade.php +++ b/resources/views/shipping/carriers/elta/label-a4-child.blade.php @@ -38,10 +38,9 @@

+ {{-- Πλήρηστοιχεία_red1 --}}
-
ΕΛΛΗΝΙΚΑ ΤΑΧΥΔΡΟΜΕΙΑ Α.Ε.
-
Απελλού 1, 105 51, Αθήνα
-
Τ. 210-6073000 | www.eltacourier.gr
+ @include('core::shipping.carriers.elta.partials._elta-details', ['style' => 'font-size:3.5pt;line-height:1.15;'])
ΕΕΤΤ ΑΜ 99-150 Γενική Αδεια Ταχ/κων Υπηρεσιών
diff --git a/resources/views/shipping/carriers/elta/label-a4.blade.php b/resources/views/shipping/carriers/elta/label-a4.blade.php index db39d1a..e5b2da6 100644 --- a/resources/views/shipping/carriers/elta/label-a4.blade.php +++ b/resources/views/shipping/carriers/elta/label-a4.blade.php @@ -35,11 +35,11 @@ .mc-text.mc-small { font-size: 4.6pt; } .mc-box { border: 1px solid #000; box-sizing: border-box; } - .mc-title { position: absolute; font-weight: bold; font-size: 8pt; text-align: center; white-space: nowrap; } + .mc-title { position: absolute; font-weight: bold; font-size: 8pt; line-height: 1; text-align: center; white-space: nowrap; } .mc-barcode { position: absolute; text-align: center; } - .mc-barcode img { height: 26px; } - .mc-voucher { position: absolute; text-align: center; font-weight: bold; font-size: 10.5pt; letter-spacing: 0.5px; } - .mc-copylabel { position: absolute; text-align: center; font-weight: bold; font-size: 8pt; } + .mc-barcode img { width: 100%; height: 22px; } + .mc-voucher { position: absolute; text-align: center; font-weight: bold; font-size: 10.5pt; line-height: 1; letter-spacing: 0.5px; } + .mc-copylabel { position: absolute; text-align: center; font-weight: bold; font-size: 8pt; line-height: 1; } .mc-cell { border: 1px solid #000; box-sizing: border-box; padding: 1px 2px; } .mc-cell-label { font-size: 5.5pt; } @@ -74,7 +74,7 @@ that embedded bitmap. transform:rotate() (not writing-mode:vertical-rl, confirmed broken in dompdf) rotates a normal-flow block. */ - .stub-strip { position: absolute; top: 2.25cm; left: 15.42cm; width: 5.58cm; height: 6.16cm; border-left: 1px dashed #000; } + .stub-strip { position: absolute; top: 2.25cm; left: 16.05cm; width: 4.90cm; height: 6.16cm; border-left: 1px dashed #000; } .stub-vtext { position: absolute; top: 2.6cm; left: -1.3cm; width: 6cm; text-align: center; font-size: 6pt; font-weight: bold; @@ -101,7 +101,7 @@
✂ ΑΠΟΚΟΨΤΕ ΕΔΩ
{{-- Copy 2: sender's copy — RDLC band top≈8.94cm on the full page --}} -
+
@include('core::shipping.carriers.elta.partials._main-copy', ['copyType' => 'sender'])
diff --git a/resources/views/shipping/carriers/elta/label-a6.blade.php b/resources/views/shipping/carriers/elta/label-a6.blade.php index bd2604f..3a3029d 100644 --- a/resources/views/shipping/carriers/elta/label-a6.blade.php +++ b/resources/views/shipping/carriers/elta/label-a6.blade.php @@ -79,6 +79,10 @@ + {{-- Πλήρηστοιχεία_black1: ELTA's company details, next to the logo --}} +
+ @include('core::shipping.carriers.elta.partials._elta-details', ['style' => 'font-size:4.2pt;']) +
ΥΠΗΡΕΣΙΑ: {{ $service_code }}
{{ $service_name }}
@@ -122,7 +126,7 @@ -
{{ $xreosi }}
+
{{ $xreosi }}
{{ $ocr_reference }}
@@ -147,7 +151,7 @@
ΟΓΚΟΜΕΤΡΙΚΟ ΒΑΡΟΣ(Kgr)
-
{{ $volumetric_weight }}
+
{{ $volumetric_weight }}
Τεμάχια
diff --git a/resources/views/shipping/carriers/elta/partials/_elta-details.blade.php b/resources/views/shipping/carriers/elta/partials/_elta-details.blade.php new file mode 100644 index 0000000..75305b5 --- /dev/null +++ b/resources/views/shipping/carriers/elta/partials/_elta-details.blade.php @@ -0,0 +1,15 @@ +{{-- + ELTA's company details exactly as its client prints them — the + "Πλήρηστοιχεία" images in sydetaE / sydetaE1 / SydetaLabelE (see + docs/elta.md, B8), reproduced as text since the bitmaps aren't ours + to ship. The caller positions and sizes the block. +--}} +
+
ΕΛΛΗΝΙΚΑ ΤΑΧΥΔΡΟΜΕΙΑ Α.Ε.
+
Έδρα: Λεωφ. Ιωνίας 200 & Ιακωβάτων 61,
+
111 44 Αθήνα
+
Α.Φ.Μ.: 094026421 | Δ.Ο.Υ.: ΚΕ.ΦΟ.Δ.Ε. ΑΤΤΙΚΗΣ
+
Τ. 210-6073000 | Ε. info@elta-courier.gr
+
www.elta-courier.gr
+
Γ.Ε.ΜΗ: 001092101000
+
diff --git a/resources/views/shipping/carriers/elta/partials/_main-copy.blade.php b/resources/views/shipping/carriers/elta/partials/_main-copy.blade.php index fe3b1e6..81e473b 100644 --- a/resources/views/shipping/carriers/elta/partials/_main-copy.blade.php +++ b/resources/views/shipping/carriers/elta/partials/_main-copy.blade.php @@ -13,20 +13,16 @@ +{{-- Πλήρηστοιχεία_red1 --}}
-
ΕΛΛΗΝΙΚΑ ΤΑΧΥΔΡΟΜΕΙΑ Α.Ε.
-
Έδρα: Απελλού 1, 105 51, Αθήνα
-
Υποκ/μα: Λ. Μεσογείων 395, 153 43, Αγ. Παρασκευή
-
Α.Φ.Μ.: 094026421 | Δ.Ο.Υ.: ΚΕΦΟ.Δ.Ε. ΑΤΤΙΚΗΣ
-
Τ. 210-6073000 | Ε. info@elta-courier.gr
-
www.eltacourier.gr
+ @include('core::shipping.carriers.elta.partials._elta-details', ['style' => 'font-size:4.4pt;line-height:1.15;'])
ΕΕΤΤ ΑΜ 99-150 Γενική Αδεια Ταχ/κων Υπηρεσιών
{{-- Title / barcode / voucher, centered column at x=8.52..15.58 --}}
-
ΣΥΝΟΔΕΥΤΙΚΟ ΔΕΛΤΙΟ ΤΑΧΥΜΕΤΑΦΟΡΑΣ
-
+
ΣΥΝΟΔΕΥΤΙΚΟ ΔΕΛΤΙΟ ΤΑΧΥΜΕΤΑΦΟΡΑΣ
+
{{-- The RDLC's own barcode textbox uses the "Free 3 of 9 Extended" @@ -35,16 +31,18 @@ barcode image above instead (visually equivalent, actually scannable), making this second plain-text *{voucher}* line redundant with it rather than a distinct field. --}} -
{{ $voucher_no }}
+
{{ $voucher_no }}
{{-- The sender's copy carries the COD warning under the voucher (sydetaE.rdlc textbox205: antik_minima), only for cash on delivery. - Its "Απόδειξη Είσπαξης" note (textbox211) sits at the top-left in the + Its "Απόδειξη Είσπραξης" note (textbox211) sits at the top-left in the RDLC, where our header block is — it goes in this copy's COD box instead, under the breakdown. --}} -@if ($copyType === 'sender' && $antik_minima) -
{{ $antik_minima }}
+@if ($copyType === 'sender' && ($antik_minima || ($copy ?? null))) + {{-- …or the copy field (textbox "copy"): "RETOUR" on a return voucher, + which never has COD. --}} +
{{ $antik_minima ?: $copy }}
@endif {{-- 5-cell deposit/destination/weight/pieces/volumetric row — a genuinely @@ -78,7 +76,7 @@
Ογκ/κο Βάρος
-
{{ $volumetric_weight }}
+
{{ str_replace(' = ', '=', (string) $volumetric_weight) }}
@@ -132,12 +130,12 @@ @endforeach
-
+
* REFERENCE No*
{{ $order_reference }}
-
+
* ΠΑΡΑΤΗΡΗΣΕΙΣ *
{{-- sxolia_1..3 (textbox92/95/94) --}} @foreach ($sxolia as $i => $line) @@ -156,7 +154,7 @@
ΓΙΑ ΤΗΝ ΠΑΡΑΛΑΒΗ
ΟΝΟΜΑ/ΥΠΟΓΡΑΦΗ
-
{{ $date }} {{ $time }}
+
{{ $date }} {{ $time }}
@else
@@ -170,6 +168,6 @@
ΥΠΟΓΡΑΦΗ ΑΠΟΣΤΟΛΕΑ
-
Ημερομηνία - Ωρα Εκτύπωσης: {{ $date }} {{ $time }}
+
Ημερομηνία - Ωρα Εκτύπωσης:
{{ $date }} {{ $time }}
@endif diff --git a/resources/views/shipping/carriers/elta/partials/_payment-stub.blade.php b/resources/views/shipping/carriers/elta/partials/_payment-stub.blade.php index 98cb4d2..43a9310 100644 --- a/resources/views/shipping/carriers/elta/partials/_payment-stub.blade.php +++ b/resources/views/shipping/carriers/elta/partials/_payment-stub.blade.php @@ -1,137 +1,120 @@ {{-- - Copy 3: the ΤΑΧΥΠΛΗΡΩΜΗ ΕΙΣΠΡΑΞΗ/ΜΕΤΑΒΙΒΑΣΗ payment-receipt stub, - geometry transcribed from sydetaE.rdlc's third band (source Top - values there run ~19.22cm-27.0cm on the full A4 page; offsets below - are relative to this partial's own container, i.e. the RDLC's Top - minus 19.22cm). This band is narrower than copies 1/2 (starts at - x=3.01cm instead of x=0.27cm) — the RDLC leaves its left margin for - the perforated tear line + rotated "3. ΑΡΧΕΙΟ / ΓΡΑΦΕΙΟ ΚΑΤΑΘΕΣΗΣ" - text, reproduced by the caller outside this partial. + Copy 3: the ΤΑΧΥΠΛΗΡΩΜΗ ΕΙΣΠΡΑΞΗ/ΜΕΤΑΒΙΒΑΣΗ payment-receipt stub — + the fields of sydetaE.rdlc's third band. The RDLC's own coordinates + don't survive dompdf's font metrics (its boxes ended up overlapping), + so the stub is laid out on its own grid instead: + + left 0.00–6.00cm stations/weight/pieces, ΑΠΟΣΤΟΛΕΑΣ, ΠΑΡΑΛΗΠΤΗΣ + middle 6.20–11.00cm service, charge, Συν.Χρέωσης/remarks, ΕΠΙΒΑΡΥΝΣΕΙΣ + right 11.30cm– ELTA's company details, ΠΟΣΟ + + with the signature / COD / ΠΟΣΟ row along the bottom. The band is + 7.40cm tall (the "ΜΗ ΣΗΜΕΙΩΝΕΤΕ" line follows). Expects all of EltaLabelRenderer's $data. --}} -
-
+ +{{-- Voucher number + barcode --}} +
{{ $voucher_no }}
+
+
-
{{ $voucher_no }}
+
{{ $voucher_no }}
-
{{ $voucher_no }}
-{{-- 4-cell deposit/destination/weight/pieces row: same doubled-border - issue and same fix as _main-copy.blade.php's 5-cell row — a real - in place of 4 independently-bordered - absolute divs, positioned at the row's own RDLC top/left/width. --}} -
+{{-- Left: stations / weight / pieces (one table, so shared edges are drawn once) --}} +
- + - {{-- border-bottom:none on every cell: the ΑΠΟΣΤΟΛΕΑΣ party box - immediately below (top:2.44cm, this row ends at 2.42cm) already - draws that shared line with its own border-top. --}} - - - - + @foreach (['Γρ.Κατάθεσης' => $station_apo, 'Γρ.Προορισμού' => $station_pros, 'Βάρος' => $weight, 'Τεμάχια' => $package_label] as $label => $value) + + @endforeach
-
Γρ.Κατάθεσης
-
{{ $station_apo }}
-
-
Γρ.Προορισμού
-
{{ $station_pros }}
-
-
Βάρος
-
{{ $weight }}
-
-
Τεμάχια
-
{{ $package_label }}
-
+
{{ $label }}
+
{{ $value }}
+
-
-
{{ $service_code }}
-
{{ $service_name }}
-
-{{-- Below: several panel pairs sit a hair apart (or, for the - Συν.Χρέωσης/ΕΠΙΒΑΡΥΝΣΕΙΣ pair, even overlap slightly) per the RDLC's - own geometry — left untouched — close enough that two independent - borders read as one doubled/thick line. border-top/border-bottom is - removed from one side of each pair so only the remaining box's - border draws that shared line. --}} -
{{ str_replace(' ΠΙΣΤΩΣΗ', ' ΤΡ.ΠΛΗΡ: ΠΙΣΤΩΣΗ', $xreosi) }}
- -
-
ΑΠΟΣΤΟΛΕΑΣ
- {{-- The stub prints sender_1/sender_2 only (code + name) --}} +{{-- Left: ΑΠΟΣΤΟΛΕΑΣ — sender_1/sender_2 only (code + name), as the stub prints --}} +
+
ΑΠΟΣΤΟΛΕΑΣ
@foreach (array_slice($sender_lines, 0, 2) as $i => $line) @if (trim((string) $line) !== '') -
{{ $line }}
+
{{ $line }}
@endif @endforeach
-
-
Συν.Χρέωσης (€):
-
Πρόσθετες Υπηρεσίες
- {{-- 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) -
{{ $line }}
- @endforeach -
-
-
ΠΑΡΑΛΗΠΤΗΣ
- {{-- ...and rec_1..4: name, address, postcode — no phone --}} +{{-- Left: ΠΑΡΑΛΗΠΤΗΣ — rec_1..3: name, address, postcode (no phone) --}} +
+
ΠΑΡΑΛΗΠΤΗΣ
@foreach (array_slice($recipient_lines, 0, 3) as $i => $line) @if (trim((string) $line) !== '') -
{{ $line }}
- @endif - @endforeach -
-
-
* ΕΠΙΒΑΡΥΝΣΕΙΣ *
- {{-- sur_1..4 (textbox139-142) --}} - @foreach ([$sur_1, $sur_2, $sur_3, $sur_4] as $i => $sur) - @if (filled($sur)) -
{{ $sur }}
+
{{ $line }}
@endif @endforeach
-
+{{-- Middle: service, then the charge line --}} +
+
{{ $service_code }}
+
{{ $service_name }}
+
+
+
{{ str_replace(' ΠΙΣΤΩΣΗ', ' ΤΡ.ΠΛΗΡ: ΠΙΣΤΩΣΗ', $xreosi) }}
+
+ +{{-- Middle: Συν.Χρέωσης, Πρόσθετες Υπηρεσίες and the remarks (sxolia_1..2 on one line) --}} +
+
Συν.Χρέωσης (€):
+
Πρόσθετες Υπηρεσίες
+ @if (filled($sxolia)) +
{{ implode('', array_slice($sxolia, 0, 2)) }}
+ @endif +
+ +{{-- Middle: ΕΠΙΒΑΡΥΝΣΕΙΣ — sur_1..4 --}} +
+
* ΕΠΙΒΑΡΥΝΣΕΙΣ *
+ @foreach (array_values(array_filter([$sur_1, $sur_2, $sur_3, $sur_4])) as $i => $sur) +
{{ $sur }}
+ @endforeach +
+ +{{-- Far right: ELTA's "Hellenic Post" logo and slogan (the RDLC's + Point5_ELTACourier_ΑποστολήμαςΕσείς image, printed there on its side) --}} +
+ ΕΛΤΑ +
Αποστολή μας εσείς!
+
+ +{{-- Right: ELTA's company details (Πλήρηστοιχεία_black) --}} +
+ @include('core::shipping.carriers.elta.partials._elta-details', ['style' => 'font-size:5.4pt;line-height:1.25;']) +
+ +
Έλαβα γνώση των όρων που αναγράφονται στο αντίγραφο 1 και 6 και τους αποδέχομαι ανεπιφύλακτα
-{{-- rectangle29 --}} -
-
ΥΠΟΓΡΑΦΗ ΑΠΟΣΤΟΛΕΑ
-
{{ $date }}
+{{-- Bottom row: signatures (left), the COD breakdown antik_1..6 (middle), ΠΟΣΟ (right) --}} +
+
ΥΠΟΓΡΑΦΗ
ΑΠΟΣΤΟΛΕΑ
+
{{ $date }}
-{{-- rectangle43 --}} -
-
ΟΝΟΜΑ/ΥΠΟΓΡΑΦΗ ΠΑΡΑΛΗΠΤΗ
-
Ημ/νία:     Ώρα:
+
+
ΟΝΟΜΑ/ΥΠΟΓΡΑΦΗ
ΠΑΡΑΛΗΠΤΗ
+
Ημ/νία:     Ώρα:
-{{-- Image18: the ELTA "ΠΟΡΤΑ-ΠΟΡΤΑ" details bitmap, above ΠΟΣΟ — - approximated with our logo + the same text, since the bitmap can't - be extracted. --}} -
-
- -
-{{-- rectangle44: the COD breakdown, antik_1..6 (textbox149-151,167-169) --}} -
+
@foreach ($antik_lines as $i => $line) -
{{ $line }}
+
{{ $line }}
@endforeach
-{{-- rectangle45: Π Ο Σ Ο + antik_poso (textbox148/152) --}} -
-
Π Ο Σ Ο
-
{{ $antik_poso }}
+
+
Π Ο Σ Ο
+
{{ $antik_poso }}
diff --git a/src/Shipping/Carriers/BoxNow/BoxNowFulfillmentService.php b/src/Shipping/Carriers/BoxNow/BoxNowFulfillmentService.php index 3812f40..686f20c 100644 --- a/src/Shipping/Carriers/BoxNow/BoxNowFulfillmentService.php +++ b/src/Shipping/Carriers/BoxNow/BoxNowFulfillmentService.php @@ -8,11 +8,13 @@ use Illuminate\Support\Collection; use Lunar\Models\Order; use Modules\Core\Shipping\Carriers\BoxNow\Exceptions\BoxNowApiException; use Modules\Core\Shipping\Contracts\CarrierFulfillmentInterface; +use Modules\Core\Shipping\Contracts\CreatesStandaloneVouchers; use Modules\Core\Shipping\Contracts\SupportsTracking; use Modules\Core\Shipping\Contracts\SupportsVoucherListing; use Modules\Core\Shipping\Contracts\SupportsVoucherLookup; use Modules\Core\Shipping\DTOs\CarrierVoucher; use Modules\Core\Shipping\DTOs\ShipmentRequest; +use Modules\Core\Shipping\DTOs\VoucherRecipient; use Modules\Core\Shipping\DTOs\TrackingCheckpoint; use Modules\Core\Shipping\Enums\TrackingStatus; use Modules\Core\Shipping\Models\Shipment; @@ -31,12 +33,11 @@ use Modules\Core\Shipping\Models\Shipment; * $order->shippingAddress->meta['box_now_locker']). * * Box Now ships by compartment size, not weight — unlike ACS, which bills - * by kg. One 'items' entry per box in ShipmentRequest::$boxes, so an order - * needing more than one physical parcel (doesn't fit one compartment) - * sends that many entries in a single delivery request rather than - * several separate ones. + * by kg. Each box in ShipmentRequest::$boxes is its own delivery request + * (and so its own parcel, voucher and compartment): Box Now merges the + * items of one request into a single parcel — see create(). */ -class BoxNowFulfillmentService implements CarrierFulfillmentInterface, SupportsTracking, SupportsVoucherListing, SupportsVoucherLookup +class BoxNowFulfillmentService implements CarrierFulfillmentInterface, CreatesStandaloneVouchers, SupportsTracking, SupportsVoucherListing, SupportsVoucherLookup { private const COMPARTMENT_SIZES = ['S' => 1, 'M' => 2, 'L' => 3]; @@ -44,7 +45,35 @@ class BoxNowFulfillmentService implements CarrierFulfillmentInterface, SupportsT public function createShipment(Order $order, ShipmentRequest $request): Shipment { - $address = $order->shippingAddress; + // Box Now rejects an orderNumber it has seen before (P410), even + // for a cancelled request — so a re-created shipment after a cancel + // gets "-2", "-3", …; the first attempt keeps "{reference}-{id}". + $previousRequests = Shipment::where('order_id', $order->id) + ->where('carrier', 'box-now') + ->where('source', Shipment::SOURCE_CREATED) + ->get() + // One per attempt — the boxes of one attempt share its reference. + ->map(fn (Shipment $shipment) => $shipment->meta['reference'] ?? $shipment->meta['delivery_request_id'] ?? $shipment->id) + ->unique() + ->count(); + + $orderNumber = $order->reference.'-'.$order->id.($previousRequests > 0 ? '-'.($previousRequests + 1) : ''); + + return $this->create($request->recipient ?? VoucherRecipient::fromAddress($order->shippingAddress), $orderNumber, $request, $order); + } + + /** + * A delivery request for a parcel that isn't a shop order ("Create + * voucher" on Carrier Vouchers). Our reference is its orderNumber, so + * it must be one Box Now hasn't seen before. + */ + public function createStandaloneVoucher(VoucherRecipient $recipient, string $reference, ShipmentRequest $request): Shipment + { + return $this->create($recipient, $reference, $request); + } + + private function create(VoucherRecipient $recipient, string $orderNumber, ShipmentRequest $request, ?Order $order = null): Shipment + { $destinationLocationId = $request->destinationLocationId; if (! $destinationLocationId) { @@ -55,77 +84,105 @@ class BoxNowFulfillmentService implements CarrierFulfillmentInterface, SupportsT throw new BoxNowApiException('At least one box (compartment size) is required for a Box Now shipment.'); } - $isCod = $request->paymentMode === 'cod'; + // The locker's pickup code goes out by SMS and email. + $contactNumber = $recipient->mobile ?: $recipient->phone; - // Box Now rejects an orderNumber it has seen before (P410), even - // for a cancelled request — so a re-created shipment after a cancel - // gets "-2", "-3", …; the first attempt keeps "{reference}-{id}". - $previousRequests = Shipment::where('order_id', $order->id) - ->where('carrier', 'box-now') - ->where('source', Shipment::SOURCE_CREATED) - ->get() - ->map(fn (Shipment $shipment) => $shipment->meta['delivery_request_id'] ?? $shipment->id) - ->unique() - ->count(); - - $orderNumber = $order->reference.'-'.$order->id.($previousRequests > 0 ? '-'.($previousRequests + 1) : ''); - - $response = $this->client->request('post', '/delivery-requests', [ - 'orderNumber' => $orderNumber, - 'invoiceValue' => number_format($order->total->decimal, 2, '.', ''), - 'paymentMode' => $isCod ? 'cod' : 'prepaid', - 'amountToBeCollected' => $isCod - ? number_format($request->amountToCollect ?? $order->total->decimal, 2, '.', '') - : '0.00', - 'origin' => [ - 'contactNumber' => config('boxnow.sender.phone'), - 'contactEmail' => config('boxnow.sender.email'), - 'contactName' => config('boxnow.sender.name'), - 'locationId' => config('boxnow.origin_location_id'), - ], - 'destination' => [ - 'contactNumber' => $this->internationalPhone($address->contact_phone), - 'contactEmail' => $address->contact_email, - 'contactName' => trim("{$address->first_name} {$address->last_name}"), - 'locationId' => $destinationLocationId, - ], - 'items' => collect($request->boxes)->values()->map(fn (string $size, int $index) => [ - 'id' => $order->id.'-'.($index + 1), - 'name' => 'Order '.$order->reference.' (box '.($index + 1).')', - 'value' => '0.00', - 'compartmentSize' => self::COMPARTMENT_SIZES[$size] ?? self::COMPARTMENT_SIZES['S'], - ])->all(), - ]); - - $parcels = collect($response['parcels'] ?? []); - - if ($parcels->isEmpty()) { - throw new BoxNowApiException('Box Now delivery request succeeded but returned no parcel ids.', $response); + if (blank($contactNumber) || blank($recipient->email)) { + throw new BoxNowApiException('Box Now needs the recipient\'s mobile and email — the locker pickup code is sent to both.'); } - // One Shipment row per box/parcel — each is independently - // trackable/printable/cancellable via its own tracking_reference - // (printLabel()/cancelShipment()/trackShipment() below already - // operate per-Shipment), even though all boxes were submitted in - // one delivery request. Siblings are linked via the shared - // delivery_request_id in meta. - // The cash is collected once for the whole request, so only the - // first parcel carries cod_amount. - $codAmount = $isCod ? (float) ($request->amountToCollect ?? $order->total->decimal) : null; + $isCod = $request->paymentMode === 'cod'; + $codAmount = $isCod ? (float) ($request->amountToCollect ?? $order?->total->decimal) : null; - $shipments = $parcels->values()->map(fn (array $parcel, int $index) => Shipment::create([ - 'order_id' => $order->id, - 'carrier' => 'box-now', - 'tracking_reference' => (string) $parcel['id'], - 'meta' => [ - 'delivery_request_id' => $response['id'] ?? null, - 'reference' => $orderNumber, - 'locker_id' => $destinationLocationId, - 'cod_amount' => $index === 0 ? $codAmount : null, - ], - ])); + if ($isCod && ! $codAmount) { + throw new BoxNowApiException('Enter the cash on delivery amount.'); + } - return $shipments->first(); + // The parcel's value: the order's total, or what staff entered + // (falling back to the cash to collect). + $value = $order?->total->decimal ?? $request->value ?? $codAmount ?? 0; + + // One delivery request per box. Box Now's manual says every entry + // in "items" becomes its own parcel, but in practice (staging, + // Any-APM origin, verified 2026-10-01 with our payload and with + // the official plugin's) it puts all items of a request into ONE + // parcel at the largest size — two boxes would get one voucher. + // A request per box gives each box its own parcel, label and + // compartment. Each needs its own orderNumber ("-b1", "-b2", …); + // the order's value and any cash on delivery go on the first box. + $boxes = array_values($request->boxes); + $count = count($boxes); + $shipments = []; + + try { + foreach ($boxes as $index => $size) { + $first = $index === 0; + $boxNumber = $count > 1 ? "{$orderNumber}-b".($index + 1) : $orderNumber; + + $response = $this->client->request('post', '/delivery-requests', [ + 'orderNumber' => $boxNumber, + 'invoiceValue' => number_format($first ? $value : 0, 2, '.', ''), + 'paymentMode' => $isCod && $first ? 'cod' : 'prepaid', + 'amountToBeCollected' => number_format($first ? ($codAmount ?? 0) : 0, 2, '.', ''), + 'origin' => [ + 'contactNumber' => config('boxnow.sender.phone'), + 'contactEmail' => config('boxnow.sender.email'), + 'contactName' => config('boxnow.sender.name'), + 'locationId' => config('boxnow.origin_location_id'), + ], + 'destination' => [ + 'contactNumber' => $this->internationalPhone($contactNumber), + 'contactEmail' => $recipient->email, + 'contactName' => $recipient->name, + 'locationId' => $destinationLocationId, + ], + 'items' => [[ + 'id' => $boxNumber, + 'name' => ($order ? 'Order '.$order->reference : $orderNumber).($count > 1 ? ' (box '.($index + 1).' of '.$count.')' : ''), + 'value' => '0.00', + 'weight' => 0, + 'compartmentSize' => self::COMPARTMENT_SIZES[$size] ?? self::COMPARTMENT_SIZES['S'], + ]], + ]); + + $parcelId = $response['parcels'][0]['id'] ?? null; + + if (! $parcelId) { + throw new BoxNowApiException('Box Now delivery request succeeded but returned no parcel id.', $response); + } + + $shipments[] = Shipment::create([ + 'order_id' => $order?->id, + 'carrier' => 'box-now', + 'tracking_reference' => (string) $parcelId, + 'meta' => [ + 'delivery_request_id' => $response['id'] ?? null, + // Shared by the boxes of one shipment; each box's + // own orderNumber is box_order_number. + 'reference' => $orderNumber, + 'box_order_number' => $boxNumber, + 'locker_id' => $destinationLocationId, + 'cod_amount' => $first ? $codAmount : null, + ...($count > 1 ? ['box' => $index + 1, 'boxes' => $count] : []), + // Who it goes to, as sent (Shipment::recipient()). + 'recipient' => $recipient->toArray(), + ], + ]); + } + } catch (\Throwable $e) { + // No half shipments: cancel the boxes already created. + foreach ($shipments as $shipment) { + try { + $this->cancelShipment($shipment); + } catch (\Throwable $cancelFailure) { + report($cancelFailure); + } + } + + throw $e; + } + + return $shipments[0]; } /** diff --git a/src/Shipping/Carriers/Elta/EltaClient.php b/src/Shipping/Carriers/Elta/EltaClient.php index 027db9a..112e3d7 100644 --- a/src/Shipping/Carriers/Elta/EltaClient.php +++ b/src/Shipping/Carriers/Elta/EltaClient.php @@ -5,6 +5,8 @@ namespace Modules\Core\Shipping\Carriers\Elta; use DOMDocument; use DOMElement; use DOMXPath; +use Illuminate\Http\Client\ConnectionException; +use Illuminate\Http\Client\RequestException; use Illuminate\Support\Facades\Http; use Modules\Core\Shipping\Carriers\Elta\Exceptions\EltaApiException; @@ -12,7 +14,8 @@ use Modules\Core\Shipping\Carriers\Elta\Exceptions\EltaApiException; * SOAP transport for ELTA Courier's web services. * * ELTA runs two parallel operation families at the same endpoint - * (212.205.47.226:9003). The original CREATEAWB/PELB64VG/PELTT01/PELSTATION + * (https://clients.elta-courier.gr; formerly 212.205.47.226:9003, which is + * plain HTTP only — see docs/elta.md). The original CREATEAWB/PELB64VG/PELTT01/PELSTATION * set (sourced from the unofficial chinchillabrains/eltaws reference client) * rejects this account's credentials with st_flag=3 ("invalid password"). * Decompiling ELTA's own official desktop client (ELTA_PEL.exe, from their @@ -99,6 +102,15 @@ class EltaClient return $this->call('PELTKNEW', $params); } + /** + * PELTKBOX: the PostBox station and service for a postcode — what the + * client calls instead of PELTKNEW when "ΕΠΙΔΟΣΗ POST BOX" is ticked. + */ + public function getPostBoxStation(array $params): EltaResponse + { + return $this->call('PELTKBOX', $params); + } + private function call(string $operation, array $params): EltaResponse { $namespace = '/'.$operation; @@ -112,11 +124,17 @@ class EltaClient .'' .''.$body.''; + // The host occasionally times out or answers a one-off 500; two + // quick retries cover that. Every call is idempotent except + // PELVGNEW, where a retry after a lost response could create a + // duplicate pending voucher — rare, and visible in the pending list. $response = Http::withHeaders([ 'SOAPAction' => 'Get', 'Content-Type' => 'text/xml', ]) ->timeout($this->config['timeout']) + ->retry(2, 500, fn (\Throwable $e) => $e instanceof ConnectionException + || ($e instanceof RequestException && $e->response->serverError()), throw: false) ->withBody($envelope, 'text/xml') ->post($this->config['service_location']); diff --git a/src/Shipping/Carriers/Elta/EltaFulfillmentService.php b/src/Shipping/Carriers/Elta/EltaFulfillmentService.php index 6f9ca21..fe121b3 100644 --- a/src/Shipping/Carriers/Elta/EltaFulfillmentService.php +++ b/src/Shipping/Carriers/Elta/EltaFulfillmentService.php @@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Cache; use Lunar\Models\Order; use Modules\Core\Shipping\Carriers\Elta\Exceptions\EltaApiException; use Modules\Core\Shipping\Contracts\CarrierFulfillmentInterface; +use Modules\Core\Shipping\Contracts\CreatesStandaloneVouchers; use Modules\Core\Shipping\Contracts\IssuesVoucherOnPrint; use Modules\Core\Shipping\Contracts\SupportsBatchLabels; use Modules\Core\Shipping\Contracts\SupportsExtraServices; @@ -18,6 +19,7 @@ use Modules\Core\Shipping\Contracts\SupportsVoucherLookup; use Modules\Core\Shipping\DTOs\CarrierVoucher; use Modules\Core\Shipping\DTOs\ShipmentRequest; use Modules\Core\Shipping\DTOs\TrackingCheckpoint; +use Modules\Core\Shipping\DTOs\VoucherRecipient; use Modules\Core\Shipping\Enums\ExtraService; use Modules\Core\Shipping\Enums\TrackingStatus; use Modules\Core\Shipping\Models\Shipment; @@ -33,7 +35,7 @@ use Modules\Core\Shipping\Models\Shipment; * * Not SupportsManifestBatching — ELTA has no manifest/pickup-list step. */ -class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVoucherOnPrint, SupportsBatchLabels, SupportsExtraServices, SupportsTracking, SupportsVoucherListing, SupportsVoucherLookup +class EltaFulfillmentService implements CarrierFulfillmentInterface, CreatesStandaloneVouchers, IssuesVoucherOnPrint, SupportsBatchLabels, SupportsExtraServices, SupportsTracking, SupportsVoucherListing, SupportsVoucherLookup { /** PELMANIF2 / PELPARALVGNEW1 page through 100 rows at a time. */ private const MAX_PAGES = 50; @@ -53,40 +55,109 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch ExtraService::SaturdayDelivery->value => '004', ExtraService::TimedDelivery->value => '003', ExtraService::SpecialHandling->value => '002', + ExtraService::PostBoxDelivery->value => '917', ExtraService::Insurance->value => 'pel_asf_poso', ]; } public function createShipment(Order $order, ShipmentRequest $request): Shipment { - $address = $order->shippingAddress; + return $this->create($request->recipient ?? VoucherRecipient::fromAddress($order->shippingAddress), (string) $order->reference, $request, $order); + } + + /** + * A voucher for a parcel that isn't a shop order ("Create voucher" on + * Carrier Vouchers): created pending, exactly like an order's. + */ + public function createStandaloneVoucher(VoucherRecipient $recipient, string $reference, ShipmentRequest $request): Shipment + { + return $this->create($recipient, $reference, $request); + } + + private function create(VoucherRecipient $recipient, string $reference, ShipmentRequest $request, ?Order $order = null): Shipment + { + // Where the staff fix a missing or wrong phone: the order's + // shipping address, or the form they're filling in. + $fixIt = $order ? ' — add one to the shipping address.' : '.'; + $given = $recipient->phones(); $weight = $request->weight ?? 0.5; - $surcharges = $this->surchargeCodes($request); + $surcharges = $this->surchargeSlots($request); + + // The rules ELTA's own client checks before calling (docs/elta.md, + // A5) — ELTA itself accepts a pending voucher without them. + if ($request->packageCount > 20) { + throw new EltaApiException('ELTA allows at most 20 pieces per voucher.'); + } + + // All three dimensions or none, whole cm up to 999 ("Λάθος + // Διαστάσεις"); volumetric weight = X × Y × Z ÷ 5000. + $dimensions = $request->dimensions ? array_map('intval', array_values($request->dimensions)) : null; + + if ($dimensions && (count($dimensions) !== 3 || min($dimensions) < 1 || max($dimensions) > 999)) { + throw new EltaApiException('ELTA needs all three dimensions, in whole cm from 1 to 999.'); + } + + $volumetric = $dimensions ? number_format(array_product($dimensions) / 5000, 3, '.', '') : null; + + [$phone, $mobile] = $this->phones((string) $recipient->phone); + + if (filled($recipient->mobile)) { + [$otherPhone, $otherMobile] = $this->phones($recipient->mobile); + $phone = $phone ?: $otherPhone; + $mobile = $mobile ?: $otherMobile; + } + + if ($phone === '' && $mobile === '') { + throw new EltaApiException('ELTA needs a recipient phone number'.$fixIt); + } + + $postBox = $request->has(ExtraService::PostBoxDelivery); + + if ($postBox) { + match (true) { + $request->has(ExtraService::SpecialHandling) => throw new EltaApiException("ELTA doesn't allow PostBox delivery with special handling."), + $request->paymentMode === 'cod' => throw new EltaApiException("ELTA doesn't allow PostBox delivery with cash on delivery."), + // ELTA's client: "Χωρίς Κινητό" / "Λάθος Κινητό Τηλέφωνο". + $mobile === '' => throw new EltaApiException($order + ? "ELTA needs a mobile number (10 digits, starting with 69) for PostBox delivery — the shipping address has \"{$given}\"." + : "ELTA needs a mobile number (10 digits, starting with 69) for PostBox delivery — \"{$given}\" isn't one."), + default => null, + }; + } // 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); + $remarks = mb_substr(trim(preg_replace('/\s+/u', ' ', (string) $recipient->notes)), 0, 90); + + $routing = $postBox + ? $this->postBoxRouting($recipient->postcode, $recipient->city) + : $this->routing($recipient->postcode, $recipient->city); $params = [ 'pel_apost_code' => config('elta.apost_code'), - 'pel_paral_name' => trim("{$address->first_name} {$address->last_name}"), - 'pel_paral_address' => $address->line_one, - 'pel_paral_area' => $address->city, - 'pel_paral_tk' => $address->postcode, - 'pel_paral_thl_1' => $address->contact_phone, - 'pel_paral_thl_2' => '', - 'pel_service' => '', + 'pel_paral_name' => $recipient->name, + 'pel_paral_address' => $recipient->address, + 'pel_paral_area' => $routing['area'], + 'pel_paral_tk' => $recipient->postcode, + 'pel_paral_thl_1' => $phone, + 'pel_paral_thl_2' => $mobile, + 'pel_service' => $routing['service'], 'pel_baros' => number_format($weight, 3, '.', ''), - 'pel_baros_xyz' => '', - 'pel_x' => '', - 'pel_y' => '', - 'pel_z' => '', + 'pel_baros_xyz' => $volumetric ?? '', + 'pel_x' => $dimensions ? (string) $dimensions[0] : '', + 'pel_y' => $dimensions ? (string) $dimensions[1] : '', + 'pel_z' => $dimensions ? (string) $dimensions[2] : '', 'pel_temaxia' => (string) $request->packageCount, - 'pel_paral_sxolia' => $remarks, - 'pel_sur_1' => $surcharges[0] ?? '', - 'pel_sur_2' => $surcharges[1] ?? '', - 'pel_sur_3' => $surcharges[2] ?? '', + // Remarks right-aligned in 99 characters, then "2" = parcel or + // "1" = envelope — the client's encoding of its mandatory + // envelope/parcel choice. ELTA keeps the digit as the + // last character of the stored remarks. Padded by characters, + // not bytes (sprintf), so Greek remarks line up too. + 'pel_paral_sxolia' => str_repeat(' ', 99 - mb_strlen($remarks)).$remarks.($request->envelope ? '1' : '2'), + 'pel_sur_1' => $surcharges[1], + 'pel_sur_2' => $surcharges[2], + 'pel_sur_3' => $surcharges[3], // pel_ant_poso is the cash-on-delivery amount; pel_ant_poso1..4 // are cheques (with dates) in ELTA's client — never used here. 'pel_ant_poso' => '', @@ -105,17 +176,25 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch // Our order reference — comes back in ELTA's lists and tracking, // which is how we find the pending voucher's id below and match // vouchers to orders on the Carrier Vouchers screen. - 'pel_ref_no' => (string) $order->reference, + 'pel_ref_no' => $reference, // "0" = save without issuing (see this class's docblock). 'pel_insert_flag' => '0', 'pel_paral_code' => '', - 'pel_retur_code' => '', + // Special handling needs a return-to party; the client defaults + // it to the sender (us). ELTA then issues a return voucher + // (return_vg) along with the main one — printed as RETOUR. + 'pel_retur_code' => $request->has(ExtraService::SpecialHandling) ? (string) config('elta.apost_code') : '', ]; $codAmount = null; if ($request->paymentMode === 'cod') { - $codAmount = $request->amountToCollect ?? $order->total->decimal; + $codAmount = $request->amountToCollect ?? $order?->total->decimal; + + if (! $codAmount) { + throw new EltaApiException('Enter the cash on delivery amount.'); + } + $params['pel_ant_poso'] = number_format($codAmount, 2, '.', ''); } @@ -127,16 +206,23 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch // pending list by our reference. Saved even if that lookup fails — // the voucher exists at ELTA either way, and printing retries it. $master = Shipment::create([ - 'order_id' => $order->id, + 'order_id' => $order?->id, 'carrier' => 'elta', 'source' => Shipment::SOURCE_CREATED, 'tracking_reference' => null, 'meta' => [ - 'carrier_id' => $this->findPendingVoucherId((string) $order->reference), - 'reference' => (string) $order->reference, + 'carrier_id' => $this->findPendingVoucherId($reference), + 'reference' => $reference, + // Who it goes to, as sent — the label and the lists read it + // from here (Shipment::recipient()), never from the order. + 'recipient' => $recipient->toArray(), 'delivery_instructions' => $remarks ?: null, + 'routing' => $routing['note'], 'weight' => $weight, 'package_count' => $pieces, + // The label's volumetric cell, as the client prints it (ogos_2). + 'volumetric_weight' => $dimensions ? implode('x', $dimensions).' = '.$volumetric : null, + 'envelope' => $request->envelope ?: null, 'cod_amount' => $codAmount, 'services' => $request->serviceValues(), 'insurance_amount' => $request->has(ExtraService::Insurance) ? $request->insuranceAmount : null, @@ -150,13 +236,13 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch // no COD or services of their own. for ($piece = 2; $piece <= $pieces; $piece++) { Shipment::create([ - 'order_id' => $order->id, + 'order_id' => $order?->id, 'carrier' => 'elta', 'source' => Shipment::SOURCE_CREATED, 'tracking_reference' => null, 'meta' => [ 'master_shipment_id' => $master->id, - 'reference' => (string) $order->reference, + 'reference' => $reference, 'piece' => $piece, 'pieces' => $pieces, 'weight' => $weight, @@ -170,35 +256,24 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch /** * Like ELTA's own client: printing the main voucher of a multi-parcel - * send prints every parcel (main first, then each child); printing a - * child prints just that parcel. Either way the main voucher is issued - * first — that's what gives the children their numbers. + * send prints every parcel (main first, then each child), then the + * return voucher when ELTA issued one; printing a child prints just + * that parcel. Either way the main voucher is issued first — that's + * what gives the children their numbers. */ public function printLabel(Shipment $shipment): string { - $master = $this->masterOf($shipment); - - $this->issue($master); - - $labels = $shipment->is($master) - ? collect([$master->refresh(), ...$this->childrenOf($master)]) - : collect([$shipment->refresh()]); - - $pdf = $this->labelRenderer->renderMany($labels); - - Shipment::whereIn('id', $labels->pluck('id'))->update(['label_printed_at' => now()]); - - return $pdf; + return $this->printLabels(collect([$shipment])); } /** * Several labels in one PDF. A selected main voucher brings its - * children along (as printLabel() does); each parcel is printed once, - * main voucher before its children. + * children and its return voucher along (as printLabel() does); each + * page is printed once, in the client's order. */ public function printLabels(Collection $shipments): string { - $labels = collect(); + $pages = collect(); foreach ($shipments as $shipment) { $master = $this->masterOf($shipment); @@ -209,13 +284,17 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch : [$shipment->refresh()]; foreach ($group as $label) { - $labels->put($label->id, $label); + $pages->put($label->id, $label); + } + + if ($shipment->is($master) && filled($master->meta['return_vg'] ?? null)) { + $pages->put("retour-{$master->id}", new EltaReturnLabel($master)); } } - $pdf = $this->labelRenderer->renderMany($labels->values()); + $pdf = $this->labelRenderer->renderMany($pages->values()); - Shipment::whereIn('id', $labels->keys())->update(['label_printed_at' => now()]); + Shipment::whereIn('id', $pages->whereInstanceOf(Shipment::class)->keys())->update(['label_printed_at' => now()]); return $pdf; } @@ -308,6 +387,8 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch // delivered parcel yet. $isDelivered = filled(trim($response->data['pel_rec']['a_rec_date_time'] ?? '', ' /:')); + $this->storeDeliveryDetails($shipment, (array) ($response->data['pel_rec'] ?? [])); + return collect(array_values($rows))->map(function (array $row, int $index) use ($rows, $isDelivered) { $isLast = $index === count($rows) - 1; $dateTime = $row['web_date_time'] ?? ''; @@ -326,6 +407,38 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch }); } + /** + * What tracking's voucher record (pel_rec) says beyond the checkpoints: + * who received the parcel and when (a_rec_name / a_rec_date_time, blank + * until delivery), and the COD remittance — the cash ELTA paid back to + * us (a_antik1 / a_antik_text1). Kept on the shipment's meta as ELTA + * reports them; saved only when something changed. + * + * @param array $record + */ + private function storeDeliveryDetails(Shipment $shipment, array $record): void + { + $text = fn (string $key) => trim((string) ($record[$key] ?? ''), " \t\n\r\0\x0B/:") !== '' + ? trim((string) $record[$key]) + : null; + + $details = array_filter([ + 'delivered_to' => $text('a_rec_name'), + 'delivered_at' => $text('a_rec_date_time'), + 'cod_remitted' => (float) ($record['a_antik1'] ?? 0) > 0 ? (float) $record['a_antik1'] : null, + 'cod_remittance' => $text('a_antik_text1'), + ], fn ($value) => $value !== null); + + $meta = $shipment->meta?->toArray() ?? []; + + if ($details === [] || array_intersect_assoc($details, $meta) === $details) { + return; + } + + $shipment->meta = array_merge($meta, $details); + $shipment->save(); + } + /** * PELMANIF2 (the client's "Πολλαπλή Αναζήτηση"): every issued voucher * in the date range with its latest status. A second pass with @@ -423,6 +536,7 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch 'rec_srv' => $data['rec_srv'] ?? null, 'rec_srv_t' => $data['rec_srv_t'] ?? null, 'return_vg' => trim((string) ($data['return_vg'] ?? '')) ?: null, + 'r_ocr_line' => trim((string) ($data['r_ocr_line'] ?? '')) ?: null, 'epitagh_vg' => trim((string) ($data['epitagh_vg'] ?? '')) ?: null, ]); $shipment->save(); @@ -458,25 +572,141 @@ class EltaFulfillmentService implements CarrierFulfillmentInterface, IssuesVouch /** * @return array */ - private function surchargeCodes(ShipmentRequest $request): array + /** + * ELTA's surcharge slots are fixed, as its client fills them: special + * handling in pel_sur_1, set time in pel_sur_2, Saturday in pel_sur_3. + * ELTA stores whatever slot it's sent (it doesn't reorder them), and its + * own client only reads Saturday from slot 3. + * + * @return array{1: string, 2: string, 3: string} + */ + private function surchargeSlots(ShipmentRequest $request): array { - $codes = $this->extraServices(); + return [ + 1 => match (true) { + $request->has(ExtraService::SpecialHandling) => '002', + $request->has(ExtraService::PostBoxDelivery) => '917', + default => '', + }, + 2 => $request->has(ExtraService::TimedDelivery) ? '003' : '', + 3 => $request->has(ExtraService::SaturdayDelivery) ? '004' : '', + ]; + } - return collect($request->services) - ->reject(fn (ExtraService $service) => $service === ExtraService::Insurance) - ->map(fn (ExtraService $service) => $codes[$service->value] ?? null) - ->filter() - ->values() - ->take(3) - ->all(); + /** + * The recipient's number as ELTA's two phone fields take it: 10 digits + * (a +30 / 0030 prefix dropped); a mobile (69…) goes in the mobile + * field, anything else in the phone field. + * + * @return array{0: string, 1: string} [phone, mobile] + */ + private function phones(string $number): array + { + $digits = preg_replace('/\D/', '', $number); + $digits = preg_replace('/^(0030|30)(?=\d{10}$)/', '', $digits); + + if (strlen($digits) !== 10) { + return [substr($digits, 0, 10), '']; + } + + return str_starts_with($digits, '69') ? ['', $digits] : [$digits, '']; + } + + /** + * The service and area ELTA's client would send (docs/elta.md, A4): + * PELTKNEW from our station gives the postcode's service. When the + * postcode is split into localities, the customer's city is matched to + * one — the area becomes "code/title" and the service 231 (hard to + * reach) or 201. Without a match the service is left for ELTA to + * decide, as before, and the note says so. + * + * @return array{service: string, area: string, note: ?string} + */ + private function routing(string $postcode, string $city): array + { + $response = $this->client->getStation([ + 'pel_tk' => $postcode, + 'sender_station' => $this->senderStation(), + ]); + + if ($response->hasError) { + throw new EltaApiException("ELTA doesn't accept the postcode {$postcode}: {$response->errorMessage}", $response->data); + } + + $fields = $response->data['pel_fields'] ?? []; + $localities = array_values(array_filter( + (array) ($response->data['a_lview_data'] ?? []), + fn ($row) => is_array($row) && filled($row['wloc_code'] ?? null) && trim($row['wloc_code']) !== '0', + )); + + if ($localities === []) { + return ['service' => trim($fields['pel_service'] ?? ''), 'area' => $city, 'note' => null]; + } + + $wanted = $this->comparable($city); + $matches = array_values(array_filter($localities, fn ($row) => $this->comparable($row['wloc_title'] ?? '') === $wanted)); + + if (count($matches) !== 1) { + return ['service' => '', 'area' => $city, 'note' => "No single ELTA locality matches \"{$city}\" in {$postcode}; ELTA chose the service."]; + } + + $locality = $matches[0]; + + return [ + 'service' => trim($locality['wloc_disp_flag'] ?? '') === '1' ? '231' : '201', + 'area' => trim($locality['wloc_code']).'/'.trim($locality['wloc_title']), + 'note' => null, + ]; + } + + /** + * PostBox delivery routes through PELTKBOX instead (the client's + * "ΕΠΙΔΟΣΗ POST BOX"): it gives the PostBox station's service, or + * "Το Τ.Κ. Δεν Εχει PostBox" when the postcode has none. + * + * @return array{service: string, area: string, note: ?string} + */ + private function postBoxRouting(string $postcode, string $city): array + { + $response = $this->client->getPostBoxStation([ + 'pel_tk' => $postcode, + 'sender_station' => $this->senderStation(), + ]); + + if ($response->hasError) { + throw new EltaApiException("ELTA can't deliver to a PostBox for {$postcode}: {$response->errorMessage}", $response->data); + } + + $fields = $response->data['pel_fields'] ?? []; + $station = trim($fields['rec_station_t'] ?? ''); + + return [ + 'service' => trim($fields['pel_service'] ?? ''), + 'area' => $city, + 'note' => $station !== '' ? "PostBox: {$station}" : null, + ]; + } + + /** + * Upper-case, without accents or punctuation — ELTA's locality titles + * and customers' city names differ in exactly those ways. + */ + private function comparable(string $text): string + { + $text = mb_strtoupper(trim($text)); + $text = strtr($text, ['Ά' => 'Α', 'Έ' => 'Ε', 'Ή' => 'Η', 'Ί' => 'Ι', 'Ό' => 'Ο', 'Ύ' => 'Υ', 'Ώ' => 'Ω', 'Ϊ' => 'Ι', 'Ϋ' => 'Υ']); + + return preg_replace('/[^\p{L}\p{N}]+/u', ' ', $text); } private function pendingVoucherId(Shipment $shipment): string { $id = $shipment->meta['carrier_id'] ?? null; - if (blank($id) && $shipment->order) { - $id = $this->findPendingVoucherId((string) $shipment->order->reference); + $reference = $shipment->meta['reference'] ?? $shipment->order?->reference; + + if (blank($id) && filled($reference)) { + $id = $this->findPendingVoucherId((string) $reference); if ($id) { $shipment->meta = array_merge($shipment->meta?->toArray() ?? [], ['carrier_id' => $id]); diff --git a/src/Shipping/Carriers/Elta/EltaLabelRenderer.php b/src/Shipping/Carriers/Elta/EltaLabelRenderer.php index 9cce3fd..4138c17 100644 --- a/src/Shipping/Carriers/Elta/EltaLabelRenderer.php +++ b/src/Shipping/Carriers/Elta/EltaLabelRenderer.php @@ -5,7 +5,9 @@ namespace Modules\Core\Shipping\Carriers\Elta; use Barryvdh\DomPDF\Facade\Pdf; use Illuminate\Support\Carbon; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Str; +use Modules\Core\Shipping\DTOs\VoucherRecipient; use Modules\Core\Shipping\Models\Shipment; use Picqer\Barcode\BarcodeGeneratorPNG; @@ -38,6 +40,7 @@ class EltaLabelRenderer 'special_handling' => '002 ΕΙΔΙΚΗ ΔΙΑΧΕΙΡΗΣΗ', 'timed_delivery' => '003 ΠΡΟΚΑΘΟΡΙΣΜΕΝΗ ΩΡΑ', 'saturday_delivery' => '004 ΕΠΙΔΟΣΗ ΣΑΒΒΑΤΟΥ', + 'post_box_delivery' => '* ΠΡΟΣΟΧΗ PostBox *', ]; public function __construct(private readonly AreaResolver $areaResolver) {} @@ -54,7 +57,7 @@ class EltaLabelRenderer * (the styles are the same for every label) with a page break * between them. * - * @param Collection $shipments + * @param Collection $shipments */ public function renderMany(Collection $shipments): string { @@ -65,7 +68,9 @@ class EltaLabelRenderer $pages = []; foreach ($shipments as $shipment) { - $data = $this->data($shipment); + $data = $shipment instanceof EltaReturnLabel + ? $this->returnData($shipment->shipment) + : $this->data($shipment); // A6 prints every parcel on the same label; on A4 the extra // parcels of a multi-parcel send use ELTA's own separate, smaller @@ -113,8 +118,6 @@ class EltaLabelRenderer */ private function data(Shipment $shipment): array { - $order = $shipment->order; - $address = $order->shippingAddress; $paperSize = config('elta.label_paper_size', 'a4'); $piece = $this->pieceOf($shipment); $master = $piece['master'] ?? null; @@ -126,21 +129,30 @@ class EltaLabelRenderer array_filter($shipment->meta?->toArray() ?? [], fn ($value) => $value !== null), ); + // Who it goes to, as saved on the voucher — the label never reads + // the order. + $recipient = $shipment->recipient() ?? $master?->recipient() + ?? throw new \RuntimeException("Shipment {$shipment->id} has no recipient to print."); + // Issuing a pending voucher (PELVG01NEW1) returns the real // destination station and service; vouchers issued before that flow // existed don't have them, so fall back to the postcode lookup. $station = filled($meta['rec_station'] ?? null) ? ['code' => $meta['rec_station'], 'name' => $meta['rec_station_t'] ?? ''] - : (fn ($s) => ['code' => $s->code, 'name' => $s->name])($this->areaResolver->resolve($address->postcode)); + : (fn ($s) => ['code' => $s->code, 'name' => $s->name])($this->areaResolver->resolve($recipient->postcode)); $isChild = $piece !== null && $piece['number'] > 1; $masterVoucher = $isChild ? ($master?->tracking_reference ?? $shipment->parent_reference) : null; $services = $isChild ? [] : (array) ($meta['services'] ?? []); $surcharges = $this->surchargeSlots($services); - $cod = $isChild - ? $this->childCodFields(($master?->meta['cod_amount'] ?? null) > 0) - : $this->codFields(isset($meta['cod_amount']) ? (float) $meta['cod_amount'] : null); + $cod = match (true) { + $isChild => $this->childCodFields(($master?->meta['cod_amount'] ?? null) > 0), + // PostBox never has COD (ELTA refuses it); its antik_1 is the + // PostBox warning instead (print_vg()). + in_array('post_box_delivery', $services, true) => $this->postBoxCodFields(), + default => $this->codFields(isset($meta['cod_amount']) ? (float) $meta['cod_amount'] : null), + }; $dateTime = (string) ($meta['date_time'] ?? ''); $occurredAt = strlen($dateTime) >= 12 @@ -162,11 +174,11 @@ class EltaLabelRenderer 'sender_phone' => config('elta.sender_phone'), 'apost_code' => config('elta.apost_code'), - 'recipient_name' => trim("{$address->first_name} {$address->last_name}"), - 'recipient_address' => $address->line_one, - 'recipient_postcode' => $address->postcode, - 'recipient_area' => $address->city, - 'recipient_phone' => $address->contact_phone, + 'recipient_name' => $recipient->name, + 'recipient_address' => $recipient->address, + 'recipient_postcode' => $recipient->postcode, + 'recipient_area' => $recipient->city, + 'recipient_phone' => $recipient->phones(), // Mirrors Sydeta.cs::print_vg()'s own dataRow["sender_1..5"] / // dataRow["rec_1..5"] construction: name on its own line, then @@ -182,12 +194,7 @@ class EltaLabelRenderer config('elta.sender_address'), 'TK:'.config('elta.sender_postcode').' '.config('elta.sender_area').' ΤΗΛ:'.config('elta.sender_phone'), ], - 'recipient_lines' => [ - trim("{$address->first_name} {$address->last_name}"), - $address->line_one, - 'TK:'.$address->postcode.' '.$address->city, - 'ΤΗΛ: '.$address->contact_phone, - ], + 'recipient_lines' => $this->partyLines($recipient), 'date' => $occurredAt->format('d/m/Y'), 'time' => $occurredAt->format('H:i'), @@ -217,7 +224,9 @@ class EltaLabelRenderer // voucher (*NZ…GR*) under "ΜASTER ΣΥΔΕΤΑ" on an A4 child. 'copy' => $isChild ? ($paperSize === 'a6' ? 'ΠΟΛΛΑΠΛH' : '*'.$masterVoucher.'*') : null, - 'station_apo' => config('elta.origin_station_code'), + // Our deposit station: configured, or the one ELTA's login + // reported (cached by EltaFulfillmentService::senderStation()). + 'station_apo' => config('elta.origin_station_code') ?: Cache::get('elta.user_station'), 'station_pros' => $station['code'], 'station_pros_title' => $station['name'], @@ -238,7 +247,7 @@ class EltaLabelRenderer // The reference we send ELTA as pel_ref_no (order reference; // older vouchers were sent the order id). - 'order_reference' => $isChild ? null : (string) $order->reference, + 'order_reference' => $isChild ? null : $shipment->reference(), // ΠΑΡΑΤΗΡΗΣΕΙΣ: the remarks we sent ELTA (the customer's delivery // instructions), in the client's 27-character lines — up to 3 @@ -256,7 +265,10 @@ class EltaLabelRenderer // we never send any, so the box stays empty like the client's. 'volumetric_weight' => $meta['volumetric_weight'] ?? null, - 'eltaLogo' => $this->logoDataUri(), + 'eltaLogo' => $this->logoDataUri('elta-courier-logo.png'), + // The A4 payment stub's "Hellenic Post" logo (the RDLC's + // Point5_ELTACourier_ΑποστολήμαςΕσείς image). + 'hellenicPostLogo' => $this->logoDataUri('elta-logo.png'), ]; } @@ -275,6 +287,8 @@ class EltaLabelRenderer if ($has('special_handling')) { $slots[1] = self::SERVICE_TEXT['special_handling']; + } elseif ($has('post_box_delivery')) { + $slots[1] = self::SERVICE_TEXT['post_box_delivery']; } if ($has('timed_delivery')) { @@ -327,11 +341,95 @@ class EltaLabelRenderer ...$lines, 'antik_lines' => array_values(array_filter($lines)), 'antik_minima' => '* ΠΡΟΣΟΧΗ ΑΝΤΙΚΑΤΑΒΟΛΗ *', - 'apodiksi' => '* Απόδειξη Είσπαξης *', + 'apodiksi' => '* Απόδειξη Είσπραξης *', 'antik_poso' => $sent, ]; } + /** + * rec_1..4 as print_vg() builds them: name, address, "TK:" line, phones + * (also the RETOUR voucher's sender lines). + * + * @return array + */ + private function partyLines(VoucherRecipient $recipient): array + { + return [ + $recipient->name, + $recipient->address, + 'TK:'.$recipient->postcode.' '.$recipient->city, + 'ΤΗΛ: '.$recipient->phones(), + ]; + } + + /** + * A PostBox voucher's COD column: just the PostBox warning (antik_1). + * + * @return array + */ + private function postBoxCodFields(): array + { + return [ + ...$this->codFields(null), + 'antik_1' => self::SERVICE_TEXT['post_box_delivery'], + 'antik_lines' => [self::SERVICE_TEXT['post_box_delivery']], + ]; + } + + /** + * The return voucher ("RETOUR", docs/elta.md B6), as the client fills + * it from the main voucher: the parties swap (our customer sends it + * back to us, the return-to party), it's charged to the recipient, + * 0.100 kg, one piece, no COD, and the remarks name the main voucher. + * Service 461 when the main voucher's service is in-city (1xx), else + * 462. It goes from the main voucher's destination station back to + * ours. + * + * @return array + */ + private function returnData(Shipment $master): array + { + $data = $this->data($master); + $meta = $master->meta?->toArray() ?? []; + + $returnVoucher = (string) $meta['return_vg']; + $ocrLine = (string) ($meta['r_ocr_line'] ?? ''); + $inCity = str_starts_with((string) ($meta['rec_srv'] ?? ''), '1'); + + return [ + ...$data, + ...$this->codFields(null), + + 'sender_lines' => $this->partyLines($master->recipient()), + 'recipient_lines' => $data['sender_lines'], + + 'voucher_no' => $returnVoucher, + 'barcode_voucher' => $this->barcodeDataUri(new BarcodeGeneratorPNG(), $returnVoucher), + 'ocr_line' => $ocrLine, + 'ocr_reference' => strlen($ocrLine) >= 14 ? substr($ocrLine, 1, 13) : null, + + 'service_code' => $inCity ? '461' : '462', + 'service_name' => $inCity ? 'RETOUR ΕΝΤΟΣ ΠΟΛΗΣ' : 'RETOUR ΠΟΛΗ ΠΟΛΗ', + 'xreosi' => 'ΧΡΕΩΣΗ ΠΑΡΑΛΗΠΤΗ ΠΙΣΤΩΣΗ', + 'copy' => 'RETOUR', + + 'station_apo' => $data['station_pros'], + 'station_pros' => $data['station_apo'], + 'station_pros_title' => '', + + 'weight' => '0.100', + 'package_count' => 1, + 'package_label' => '1', + 'piece_label' => '001/001', + 'multiPiece' => false, + 'polaplo' => null, + 'isChild' => false, + + 'sur_1' => null, 'sur_2' => null, 'sur_3' => null, 'sur_4' => null, + 'sxolia' => array_slice(mb_str_split('ΣΥΔΕΤΑ '.$master->tracking_reference.' Χρέωση Πελάτη '.config('elta.apost_code'), 27), 0, 3), + ]; + } + /** * A child parcel's COD text (print_child()): only the warning, never the * amount — the cash is collected against the main voucher. @@ -404,9 +502,9 @@ class EltaLabelRenderer * vendor:publish, which isn't guaranteed to have run, and dompdf * needs either a real filesystem path or a working absolute URL. */ - private function logoDataUri(): string + private function logoDataUri(string $file): string { - $path = __DIR__.'/../../../../resources/logos/elta-courier-logo.png'; + $path = __DIR__.'/../../../../resources/logos/'.$file; return 'data:image/png;base64,'.base64_encode(file_get_contents($path)); } diff --git a/src/Shipping/Carriers/Elta/EltaReturnLabel.php b/src/Shipping/Carriers/Elta/EltaReturnLabel.php new file mode 100644 index 0000000..06f4fe7 --- /dev/null +++ b/src/Shipping/Carriers/Elta/EltaReturnLabel.php @@ -0,0 +1,17 @@ +first_name} {$address->last_name}"), + address: (string) $address->line_one, + postcode: (string) $address->postcode, + city: (string) $address->city, + phone: $address->contact_phone, + notes: $address->delivery_instructions, + email: $address->contact_email, + ); + } + + /** + * @param array $data as toArray() gives it + */ + public static function fromArray(array $data): self + { + return new self( + name: (string) ($data['name'] ?? ''), + address: (string) ($data['address'] ?? ''), + postcode: (string) ($data['postcode'] ?? ''), + city: (string) ($data['city'] ?? ''), + phone: $data['phone'] ?? null, + mobile: $data['mobile'] ?? null, + notes: $data['notes'] ?? null, + email: $data['email'] ?? null, + ); + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + 'name' => $this->name, + 'address' => $this->address, + 'postcode' => $this->postcode, + 'city' => $this->city, + 'phone' => $this->phone, + 'mobile' => $this->mobile, + 'notes' => $this->notes, + 'email' => $this->email, + ]; + } + + /** Both numbers, as they're printed on the label ("ΤΗΛ: …"). */ + public function phones(): string + { + return trim($this->phone.' '.$this->mobile); + } +} diff --git a/src/Shipping/Enums/ExtraService.php b/src/Shipping/Enums/ExtraService.php index 4ea5207..3cf96e5 100644 --- a/src/Shipping/Enums/ExtraService.php +++ b/src/Shipping/Enums/ExtraService.php @@ -23,6 +23,8 @@ enum ExtraService: string case Protocol = 'protocol'; case Refrigerated = 'refrigerated'; case ExchangePackage = 'exchange_package'; + /** Delivered to a PostBox (parcel locker / post office box) instead of the address. */ + case PostBoxDelivery = 'post_box_delivery'; /** * Admin-facing only (staff pick these), so plain English like the rest @@ -42,6 +44,7 @@ enum ExtraService: string self::Protocol => 'Protocol', self::Refrigerated => 'Refrigerated', self::ExchangePackage => 'Exchange package', + self::PostBoxDelivery => 'PostBox delivery', }; } } diff --git a/src/Shipping/Extensions/OrderShipmentsExtension.php b/src/Shipping/Extensions/OrderShipmentsExtension.php index 5063778..4b1fa0c 100644 --- a/src/Shipping/Extensions/OrderShipmentsExtension.php +++ b/src/Shipping/Extensions/OrderShipmentsExtension.php @@ -250,6 +250,25 @@ class OrderShipmentsExtension extends ViewPageExtension $parts[] = 'Manual voucher'; } + // Carrier-reported extras (ELTA so far): its routing note, the + // return voucher issued with special handling, who received the + // parcel and when, and the COD cash paid back to us. + if ($routing = $record->meta['routing'] ?? null) { + $parts[] = $routing; + } + + if ($returnVoucher = $record->meta['return_vg'] ?? null) { + $parts[] = 'Return voucher '.$returnVoucher; + } + + if ($deliveredTo = $record->meta['delivered_to'] ?? null) { + $parts[] = trim('Received by '.$deliveredTo.' '.($record->meta['delivered_at'] ?? '')); + } + + if ($remitted = $record->meta['cod_remitted'] ?? null) { + $parts[] = trim('COD paid back: €'.number_format((float) $remitted, 2).' '.($record->meta['cod_remittance'] ?? '')); + } + return implode(' · ', $parts); } diff --git a/src/Shipping/Extensions/OrderViewExtension.php b/src/Shipping/Extensions/OrderViewExtension.php index 573f9cd..cc8ede3 100644 --- a/src/Shipping/Extensions/OrderViewExtension.php +++ b/src/Shipping/Extensions/OrderViewExtension.php @@ -6,7 +6,6 @@ use Filament\Actions\Action; use Filament\Forms\Components\CheckboxList; use Filament\Forms\Components\Hidden; use Filament\Forms\Components\Placeholder; -use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TimePicker; @@ -24,8 +23,8 @@ use Modules\Core\Shipping\Contracts\SupportsExtraServices; use Modules\Core\Shipping\Contracts\SupportsVoucherLookup; use Modules\Core\Shipping\DTOs\ShipmentRequest; use Modules\Core\Shipping\Enums\ExtraService; +use Modules\Core\Shipping\Filament\Support\VoucherForm; use Modules\Core\Shipping\Models\Shipment; -use Modules\Core\Shipping\Support\BoxNowShipping; use Modules\Core\Shipping\Support\WeightCalculator; use Throwable; @@ -54,28 +53,24 @@ use Throwable; * order to 'dispatched': that happens when the carrier reports picking the * parcel up (AdvanceFulfillmentOnCarrierCheckpoint). Staff also pick the * carrier's extra services here (Saturday delivery, insurance, …) from the - * normalized ExtraService list the carrier offers. The form branches - * on which carrier the order actually uses - * (OrderFulfillmentService::carrierFor()): a weight-billed carrier (ACS) - * gets a single TOTAL weight field for the whole shipment (ACS has no - * per-package weight concept — one Weight value is sent alongside - * Item_Quantity in the same ACS_Create_Voucher call, see - * AcsFulfillmentService::createShipment()), pre-filled from the order's - * own line weights (Modules\Core\Shipping\Support\WeightCalculator) but - * still staff-editable, plus a package count (ShipmentRequest:: - * $packageCount) — more than 1 issues a main voucher plus a - * multi-part sub-voucher per extra package (persistMultipartVouchers()), - * each recorded as its own Shipment row sharing the same total weight in - * meta. Box Now, which bills by compartment size rather than - * weight, gets a repeatable list of boxes (one row per physical parcel, - * each with its own S/M/L size) instead — see - * Modules\Core\Shipping\Carriers\BoxNow\BoxNowFulfillmentService for how - * multiple boxes become multiple Shipment rows from one delivery request. - * Box Now's locker field defaults from the shopper's own checkout - * selection ($order->shippingAddress->meta['box_now_locker']) when present, - * but stays editable — staff can override to a different locker (e.g. the - * customer's choice turns out to be unavailable) or fill it in manually for - * an order placed before the checkout locker picker existed. + * normalized ExtraService list the carrier offers. The form depends on + * the order's carrier (OrderFulfillmentService::carrierFor()): + * + * - ELTA and Box Now (CreatesStandaloneVouchers) get the full voucher + * form — Modules\Core\Shipping\Filament\Support\VoucherForm, the one + * Carrier Vouchers' "Create voucher" uses — prefilled from the order: + * recipient and delivery instructions from the shipping address, weight + * from the order lines (WeightCalculator), Box Now's locker from the + * customer's checkout choice, cash on delivery read-only from the + * payment method. What staff change there (a phone, a typo in the + * address, another locker) goes to the carrier only + * (ShipmentRequest::$recipient); the order keeps what the customer + * entered. + * - A manual carrier gets its optional tracking number and a package + * count. + * - ACS gets a total weight (prefilled from the line weights) and a + * package count — more than 1 issues a main voucher plus a sub-voucher + * per extra package, each its own Shipment row. * * "Add manual voucher" records a voucher of an integrated carrier that * wasn't created through our API — the carrier's system was down and staff @@ -121,10 +116,15 @@ class OrderViewExtension extends ViewPageExtension ->label('Create Shipment') ->icon('heroicon-o-truck') ->modalSubmitActionLabel('Create Shipment') + ->modalWidth(fn (Order $record) => VoucherForm::handles($this->service()->carrierFor($record)) ? '3xl' : null) ->schema(function (Order $record) { $carrier = $this->service()->carrierFor($record); - $isBoxNow = BoxNowShipping::isDriver($carrier); - $lockerId = $record->shippingAddress?->meta['box_now_locker']['locationId'] ?? null; + + // ELTA and Box Now: the full voucher form, prefilled from the + // order (the same one Carrier Vouchers' "Create voucher" uses). + if (VoucherForm::handles($carrier)) { + return VoucherForm::schema($record); + } if ($carrier === 'manual') { return [ @@ -142,47 +142,22 @@ class OrderViewExtension extends ViewPageExtension ]; } - if (! $isBoxNow) { - return [...[ - TextInput::make('weight') - ->label('Total weight (kg)') - ->numeric() - ->minValue(0) - ->default(fn () => round(WeightCalculator::totalKg($record->lines), 2) ?: null) - ->helperText("Calculated from the order's line weights — adjust if needed, or leave blank to use the carrier's default. One figure for the whole shipment, not per package."), - TextInput::make('package_count') - ->label('Number of packages') - ->numeric() - ->integer() - ->minValue(1) - ->default(1) - ->required() - ->helperText('More than 1 issues a main voucher plus a sub-voucher per extra package, all sharing the total weight above.'), - ], ...$this->extraServiceFields($record)]; - } - + // Weight-billed carriers without the voucher form (ACS). return [...[ - TextInput::make('destination_location_id') - ->label('Box Now locker ID') - ->default($lockerId) + TextInput::make('weight') + ->label('Total weight (kg)') + ->numeric() + ->minValue(0) + ->default(fn () => round(WeightCalculator::totalKg($record->lines), 2) ?: null) + ->helperText("Calculated from the order's line weights — adjust if needed, or leave blank to use the carrier's default. One figure for the whole shipment, not per package."), + TextInput::make('package_count') + ->label('Number of packages') + ->numeric() + ->integer() + ->minValue(1) + ->default(1) ->required() - ->helperText($lockerId - ? 'Set by the customer at checkout — override if the parcel needs to go to a different locker.' - : 'No locker was selected at checkout — enter it manually.'), - Repeater::make('boxes') - ->label('Boxes') - ->schema([ - Select::make('size') - ->label('Size') - ->options(['S' => 'Small', 'M' => 'Medium', 'L' => 'Large']) - ->default('S') - ->native(false) - ->required(), - ]) - ->defaultItems(1) - ->addActionLabel('Add another box') - ->minItems(1) - ->helperText('One row per physical parcel — Box Now ships by compartment size, not weight.'), + ->helperText('More than 1 issues a main voucher plus a sub-voucher per extra package, all sharing the total weight above.'), ], ...$this->extraServiceFields($record)]; }) ->action(function (Order $record, array $data, Action $action) { @@ -203,9 +178,10 @@ class OrderViewExtension extends ViewPageExtension $services = array_map(fn (string $value) => ExtraService::from($value), $data['services'] ?? []); - $result = $this->service()->createShipment( - $record, - new ShipmentRequest( + $request = VoucherForm::handles($this->service()->carrierFor($record)) + // The recipient as staff confirmed it in the form. + ? VoucherForm::request($data, $isCod ? $record->total->decimal : null, VoucherForm::recipient($data)) + : new ShipmentRequest( weight: filled($data['weight'] ?? null) ? (float) $data['weight'] : null, packageCount: (int) ($data['package_count'] ?? 1), destinationLocationId: $data['destination_location_id'] ?? null, @@ -220,8 +196,9 @@ class OrderViewExtension extends ViewPageExtension ? ($data['delivery_until'] ?? null) : null, trackingReference: $data['tracking_reference'] ?? null, - ), - ); + ); + + $result = $this->service()->createShipment($record, $request); $this->notify($result); // The page still holds the shipments loaded before this action. diff --git a/src/Shipping/Filament/Resources/CarrierVoucherResource.php b/src/Shipping/Filament/Resources/CarrierVoucherResource.php index 6ee42e5..6b62a02 100644 --- a/src/Shipping/Filament/Resources/CarrierVoucherResource.php +++ b/src/Shipping/Filament/Resources/CarrierVoucherResource.php @@ -76,11 +76,24 @@ class CarrierVoucherResource extends Resource public static function getEloquentQuery(): Builder { - return parent::getEloquentQuery() - ->whereNotNull('tracking_reference') + return self::vouchers(parent::getEloquentQuery()) ->with(['order.shippingAddress', 'shipmentInfo']); } + /** + * Vouchers with a number, plus ours still waiting for one (an ELTA + * voucher gets its number when printed) so they can be printed from + * here too. + */ + public static function vouchers(Builder $query): Builder + { + return $query->where(fn (Builder $q) => $q + ->whereNotNull('tracking_reference') + ->orWhere(fn (Builder $pending) => $pending + ->where('source', Shipment::SOURCE_CREATED) + ->whereNull('cancelled_at'))); + } + public static function table(Table $table): Table { return $table @@ -88,8 +101,12 @@ class CarrierVoucherResource extends Resource ->columns([ TextColumn::make('tracking_reference') ->label('Tracking number') + ->placeholder('Not issued yet') ->description(fn (Shipment $record) => $record->parcelDescription()) ->copyable(), + TextColumn::make('carrier') + ->label('Carrier') + ->formatStateUsing(fn (Shipment $record) => $record->carrierLabel()), TextColumn::make('source') ->label('Source') ->badge() @@ -98,12 +115,12 @@ class CarrierVoucherResource extends Resource TextColumn::make('status') ->label('Status') ->state(fn (Shipment $record) => self::status($record)) - ->placeholder('No updates yet') + ->placeholder('None yet') ->badge() ->color(fn (Shipment $record) => self::statusColor($record)), TextColumn::make('order.reference') ->label('Order') - ->placeholder('Not linked'), + ->placeholder('None'), TextColumn::make('recipient') ->label('Recipient') ->state(fn (Shipment $record) => self::recipient($record)) @@ -114,6 +131,9 @@ class CarrierVoucherResource extends Resource ->where('tracking_reference', 'ilike', "%{$search}%") ->orWhere('meta->recipient_name', 'ilike', "%{$search}%") ->orWhere('meta->phone', 'ilike', "%{$search}%") + ->orWhere('meta->recipient->name', 'ilike', "%{$search}%") + ->orWhere('meta->recipient->phone', 'ilike', "%{$search}%") + ->orWhere('meta->recipient->mobile', 'ilike', "%{$search}%") ->orWhereHas('order', fn (Builder $order) => $order ->where('reference', 'ilike', "%{$search}%") ->orWhereHas('shippingAddress', fn (Builder $address) => $address @@ -131,6 +151,7 @@ class CarrierVoucherResource extends Resource SelectFilter::make('source')->options(self::SOURCES), ]) ->recordActions([ + self::printAction(), ViewAction::make(), ]); } @@ -145,6 +166,7 @@ class CarrierVoucherResource extends Resource ->formatStateUsing(fn (Shipment $record) => $record->carrierLabel()), TextEntry::make('tracking_reference') ->label('Voucher') + ->placeholder('Not issued yet — printing issues it') ->helperText(fn (Shipment $record) => $record->parcelDescription()) ->copyable(), TextEntry::make('source') @@ -188,12 +210,30 @@ class CarrierVoucherResource extends Resource ->state(fn (Shipment $record) => self::recipient($record)) ->placeholder('—'), TextEntry::make('postcode') - ->state(fn (Shipment $record) => $record->meta['postcode'] ?? $record->order?->shippingAddress?->postcode) + ->state(fn (Shipment $record) => self::postcode($record)) ->placeholder('—'), TextEntry::make('phone') ->state(fn (Shipment $record) => self::phone($record)) ->placeholder('—'), ]), + // What the carrier's tracking reports beyond the checkpoints + // (ELTA's pel_rec) — filled in by the tracking polls. + Section::make('Delivery') + ->columns(3) + ->schema([ + TextEntry::make('meta.delivered_to')->label('Received by')->placeholder('—'), + TextEntry::make('meta.delivered_at')->label('Received at')->placeholder('—'), + TextEntry::make('cod_remitted') + ->label('COD paid back') + ->state(fn (Shipment $record) => ($amount = $record->meta['cod_remitted'] ?? null) + ? trim('€'.number_format((float) $amount, 2).' '.($record->meta['cod_remittance'] ?? '')) + : null) + ->placeholder('—'), + TextEntry::make('meta.return_vg')->label('Return voucher')->placeholder('—'), + ]) + ->visible(fn (Shipment $record) => filled($record->meta['delivered_to'] ?? null) + || filled($record->meta['cod_remitted'] ?? null) + || filled($record->meta['return_vg'] ?? null)), Section::make('Order') ->schema([ TextEntry::make('order.reference') @@ -241,6 +281,21 @@ class CarrierVoucherResource extends Resource ]); } + /** + * Opens the voucher's label (the same signed link as the order page and + * Pending Vouchers) — for vouchers created here, from an order or with + * "Create voucher". Carrier-reported and typed-in vouchers have no label + * of ours to print. + */ + public static function printAction(): Action + { + return Action::make('print') + ->label('Print') + ->icon('heroicon-o-printer') + ->url(fn (Shipment $record) => ShipmentResource::labelUrl($record), shouldOpenInNewTab: true) + ->visible(fn (Shipment $record) => $record->hasCarrierLabel()); + } + /** * Attaches an unlinked voucher to an order (suggestions first), from the * view page. @@ -328,20 +383,25 @@ class CarrierVoucherResource extends Resource : $record->order->reference; } + /* + * A synced voucher's recipient is what the carrier reported + * (meta.recipient_name / phone / postcode); our own vouchers' is the + * one saved when they were created (Shipment::recipient()). + */ + private static function phone(Shipment $record): ?string { - return $record->meta['phone'] ?? $record->order?->shippingAddress?->contact_phone; + return $record->meta['phone'] ?? ($record->recipient()?->phones() ?: null); } private static function recipient(Shipment $record): ?string { - if ($name = $record->meta['recipient_name'] ?? null) { - return $name; - } + return $record->meta['recipient_name'] ?? ($record->recipient()?->name ?: null); + } - $address = $record->order?->shippingAddress; - - return $address ? trim("{$address->first_name} {$address->last_name}") : null; + private static function postcode(Shipment $record): ?string + { + return $record->meta['postcode'] ?? ($record->recipient()?->postcode ?: null); } /** diff --git a/src/Shipping/Filament/Resources/CarrierVoucherResource/Actions/CreateVoucherAction.php b/src/Shipping/Filament/Resources/CarrierVoucherResource/Actions/CreateVoucherAction.php new file mode 100644 index 0000000..46ddd03 --- /dev/null +++ b/src/Shipping/Filament/Resources/CarrierVoucherResource/Actions/CreateVoucherAction.php @@ -0,0 +1,86 @@ +label('Create voucher') + ->icon('heroicon-o-plus') + ->modalHeading('Create a voucher') + ->modalDescription('For a parcel that isn\'t a shop order. It\'s created with the carrier straight away.') + ->modalSubmitActionLabel('Create voucher') + ->modalWidth('3xl') + ->schema(VoucherForm::schema()) + ->action(fn (array $data, Action $action) => self::create($data, $action)) + ->visible(fn () => VoucherForm::carriers() !== []); + } + + private static function create(array $data, Action $action): void + { + $service = app(CarrierFulfillmentInterface::class, ['carrier' => $data['carrier']]); + $cod = (float) ($data['cod_amount'] ?? 0) > 0 ? (float) $data['cod_amount'] : null; + + try { + if (! $service instanceof CreatesStandaloneVouchers) { + throw new \RuntimeException('This carrier can\'t create vouchers without an order.'); + } + + $shipment = $service->createStandaloneVoucher( + VoucherForm::recipient($data), + trim($data['reference']), + VoucherForm::request($data, $cod), + ); + } catch (Throwable $e) { + report($e); + + Notification::make()->title('Failed to create the voucher: '.$e->getMessage())->danger()->send(); + + // Keep the form open with what was typed. + $action->halt(); + + return; + } + + // ELTA vouchers get their number when printed, so they wait on + // Pending Vouchers; offer the print straight away. + $pending = $service instanceof IssuesVoucherOnPrint && blank($shipment->tracking_reference); + + Notification::make() + ->title($pending ? 'Voucher created — it gets its number when printed.' : "Voucher {$shipment->tracking_reference} created.") + ->body($pending ? 'Print it now, or later from Pending Vouchers.' : null) + ->success() + ->persistent() + ->actions([ + Action::make('print') + ->label('Print') + ->url(ShipmentResource::labelUrl($shipment), shouldOpenInNewTab: true), + Action::make('pending') + ->label('Pending Vouchers') + ->url(ShipmentResource::getUrl('index')) + ->visible($pending), + ]) + ->send(); + } +} diff --git a/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ListCarrierVouchers.php b/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ListCarrierVouchers.php index bd5df29..410306b 100644 --- a/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ListCarrierVouchers.php +++ b/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ListCarrierVouchers.php @@ -13,6 +13,7 @@ use Lunar\Shipping\Facades\Shipping; use Modules\Core\Shipping\Contracts\CarrierFulfillmentInterface; use Modules\Core\Shipping\Contracts\SupportsVoucherLookup; use Modules\Core\Shipping\Filament\Resources\CarrierVoucherResource; +use Modules\Core\Shipping\Filament\Resources\CarrierVoucherResource\Actions\CreateVoucherAction; use Modules\Core\Shipping\Models\Shipment; use Modules\Core\Shipping\Services\CarrierVoucherSync; use Throwable; @@ -29,12 +30,12 @@ class ListCarrierVouchers extends ListRecords 'all' => Tab::make('All'), 'unlinked' => Tab::make('Unlinked') ->modifyQueryUsing(fn (Builder $query) => $query->whereNull('order_id')) - ->badge(fn () => Shipment::whereNotNull('tracking_reference')->whereNull('order_id')->count() ?: null), + ->badge(fn () => CarrierVoucherResource::vouchers(Shipment::query())->whereNull('order_id')->count() ?: null), 'returns' => Tab::make('Returns') ->modifyQueryUsing(fn (Builder $query) => $query->where(fn (Builder $q) => $q ->where('meta->is_return', true) ->orWhere('meta->reported_return', true))) - ->badge(fn () => Shipment::whereNotNull('tracking_reference') + ->badge(fn () => CarrierVoucherResource::vouchers(Shipment::query()) ->where(fn (Builder $q) => $q->where('meta->is_return', true)->orWhere('meta->reported_return', true)) ->count() ?: null), ]; @@ -43,6 +44,7 @@ class ListCarrierVouchers extends ListRecords protected function getHeaderActions(): array { return [ + CreateVoucherAction::make(), Action::make('lookup') ->label('Look up voucher') ->icon('heroicon-o-magnifying-glass') diff --git a/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ViewCarrierVoucher.php b/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ViewCarrierVoucher.php index bc151de..265997e 100644 --- a/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ViewCarrierVoucher.php +++ b/src/Shipping/Filament/Resources/CarrierVoucherResource/Pages/ViewCarrierVoucher.php @@ -14,12 +14,13 @@ class ViewCarrierVoucher extends ViewRecord public function getTitle(): string { - return 'Voucher '.$this->getRecord()->tracking_reference; + return 'Voucher '.($this->getRecord()->tracking_reference ?? '(not issued yet)'); } protected function getHeaderActions(): array { return [ + CarrierVoucherResource::printAction(), Action::make('open_order') ->label('Open order') ->icon('heroicon-o-arrow-top-right-on-square') diff --git a/src/Shipping/Filament/Resources/ShipmentResource.php b/src/Shipping/Filament/Resources/ShipmentResource.php index f5124c0..dd9b702 100644 --- a/src/Shipping/Filament/Resources/ShipmentResource.php +++ b/src/Shipping/Filament/Resources/ShipmentResource.php @@ -57,6 +57,8 @@ class ShipmentResource extends Resource * done: on a manifest for carriers that batch (ACS), printed for * carriers that issue the voucher on print (ELTA — every parcel of a * multi-parcel send is printed together, so they leave together). + * Includes vouchers created without an order (Carrier Vouchers' "Create + * voucher"); carrier-reported ones never show here. */ public static function getEloquentQuery(): Builder { @@ -67,7 +69,6 @@ class ShipmentResource extends Resource return parent::getEloquentQuery() ->where('source', Shipment::SOURCE_CREATED) - ->whereNotNull('order_id') ->whereNull('manifest_id') ->whereNull('cancelled_at') ->where(fn (Builder $query) => $query @@ -88,7 +89,10 @@ class ShipmentResource extends Resource ->placeholder('Not issued yet') ->description(fn (Shipment $record) => $record->parcelDescription()) ->copyable(), - TextColumn::make('order.reference')->label('Order'), + TextColumn::make('order.reference') + ->label('Order') + ->placeholder('No order') + ->description(fn (Shipment $record) => $record->order_id ? null : $record->recipient()?->name), TextColumn::make('created_at')->label('Created')->dateTime(), TextColumn::make('label_printed_at')->label('Printed')->dateTime()->placeholder('Not printed'), ]) diff --git a/src/Shipping/Filament/Support/VoucherForm.php b/src/Shipping/Filament/Support/VoucherForm.php new file mode 100644 index 0000000..d25ee3d --- /dev/null +++ b/src/Shipping/Filament/Support/VoucherForm.php @@ -0,0 +1,377 @@ + the form's components + */ + public static function schema(?Order $order = null): array + { + $carrier = $order ? self::carrierOf($order) : null; + $defaults = $order ? self::defaultsFor($order, $carrier) : [ + 'package_count' => 1, + 'weight' => 0.5, + ]; + $default = fn (string $key) => $defaults[$key] ?? null; + + return [ + $order + ? Hidden::make('carrier')->default($carrier) + : Select::make('carrier') + ->label('Carrier') + ->options(fn () => self::carriers()) + ->default(fn () => array_key_first(self::carriers())) + ->native(false) + ->live() + ->required(), + + Section::make('Recipient') + ->description($order ? 'From the order\'s shipping address — changes here go to the carrier only.' : null) + ->columns(2) + ->schema([ + TextInput::make('name')->label('Name')->required()->maxLength(150)->default($default('name'))->columnSpanFull(), + TextInput::make('address') + ->label('Address') + ->required() + ->maxLength(150) + ->default($default('address')) + ->visible(fn (Get $get) => ! self::isBoxNow($get)), + TextInput::make('postcode') + ->label('Postcode') + ->required() + ->rule('regex:/^\d{3}\s?\d{2}$/') + ->validationMessages(['regex' => 'Enter a 5-digit postcode.']) + ->default($default('postcode')) + ->visible(fn (Get $get) => ! self::isBoxNow($get)), + TextInput::make('city') + ->label('City / area') + ->required() + ->maxLength(40) + ->default($default('city')) + ->visible(fn (Get $get) => ! self::isBoxNow($get)), + TextInput::make('phone') + ->label('Phone') + ->tel() + // ELTA needs at least one of the two numbers. + ->requiredWithout('mobile') + ->validationMessages(['required_without' => 'Enter a phone or a mobile.']) + ->default($default('phone')) + ->visible(fn (Get $get) => ! self::isBoxNow($get)), + TextInput::make('mobile') + ->label('Mobile') + ->tel() + ->required(fn (Get $get) => self::isBoxNow($get)) + ->default($default('mobile')) + ->helperText(fn (Get $get) => self::isBoxNow($get) + ? 'The locker pickup code is sent here by SMS.' + : '10 digits, starting with 69 — required for PostBox delivery.'), + TextInput::make('email') + ->label('Email') + ->email() + ->required() + ->default($default('email')) + ->helperText('The locker pickup code is sent here too.') + ->visible(fn (Get $get) => self::isBoxNow($get)), + Textarea::make('notes') + ->label('Remarks for the courier') + ->maxLength(90) + ->rows(2) + ->default($default('notes')) + ->helperText('Printed in ΠΑΡΑΤΗΡΗΣΕΙΣ, up to 90 characters.') + ->columnSpanFull() + ->visible(fn (Get $get) => ! self::isBoxNow($get)), + ]), + + Section::make('Locker and boxes') + ->columns(2) + ->visible(fn (Get $get) => self::isBoxNow($get)) + ->schema([ + TextInput::make('locker_id') + ->label('Box Now locker ID') + ->required() + ->default($default('locker_id')) + ->helperText($order + ? ($default('locker_id') + ? 'Set by the customer at checkout — override if the parcel needs to go to a different locker.' + : 'No locker was selected at checkout — enter it manually.') + : null), + // An order's value is its total. + TextInput::make('value') + ->label('Parcel value') + ->numeric() + ->minValue(0) + ->prefix('€') + ->helperText('Declared to Box Now; defaults to the cash on delivery amount.') + ->visible(! $order), + Repeater::make('boxes') + ->label('Boxes') + ->schema([ + Select::make('size') + ->label('Size') + ->options(['S' => 'Small', 'M' => 'Medium', 'L' => 'Large']) + ->default('S') + ->native(false) + ->required(), + ]) + ->defaultItems(1) + ->minItems(1) + ->addActionLabel('Add another box') + ->helperText('One row per physical box — each gets its own voucher and locker compartment. Box Now ships by size, not weight.') + ->columnSpanFull(), + ]), + + Section::make('Parcel') + ->columns(2) + ->visible(fn (Get $get) => ! self::isBoxNow($get)) + ->schema([ + ToggleButtons::make('type') + ->label('Type') + ->options(['parcel' => 'Parcel', 'envelope' => 'Envelope']) + ->default('parcel') + ->inline() + ->required(), + TextInput::make('package_count') + ->label('Number of packages') + ->numeric() + ->integer() + ->minValue(1) + ->maxValue(20) + ->default($default('package_count')) + ->required() + ->helperText('More than 1 issues a main voucher plus a voucher per extra package.'), + TextInput::make('weight') + ->label('Weight') + ->numeric() + ->minValue(0.001) + ->default($default('weight')) + ->suffix('kg') + ->required() + ->helperText($order + ? 'Calculated from the order\'s line weights — adjust if needed. The whole shipment, not per package.' + : 'The whole shipment, not per package.'), + Grid::make(3) + ->schema([ + TextInput::make('length')->label('Length')->numeric()->integer()->minValue(1)->maxValue(999)->suffix('cm'), + TextInput::make('width')->label('Width')->numeric()->integer()->minValue(1)->maxValue(999)->suffix('cm'), + TextInput::make('height')->label('Height')->numeric()->integer()->minValue(1)->maxValue(999)->suffix('cm'), + ]) + ->columnSpan(1), + ]), + + Section::make('Payment and services') + ->columns(2) + ->schema([ + $order + // Whether a shipment collects cash is a fact about the + // order (its payment method), not a choice made here. + ? TextInput::make('cod_amount') + ->label('Cash on delivery') + ->prefix('€') + ->default($default('cod_amount')) + ->disabled() + ->dehydrated(false) + ->helperText('The order is paid on delivery — the courier collects its total.') + ->visible(filled($default('cod_amount'))) + : TextInput::make('cod_amount') + ->label('Cash on delivery') + ->numeric() + ->minValue(0) + ->prefix('€') + ->helperText('Leave empty when the recipient pays nothing.'), + // An order's vouchers carry the order's reference. + TextInput::make('reference') + ->label('Reference') + ->required() + ->maxLength(30) + ->default(fn () => 'V'.now()->format('ymdHis')) + ->helperText(fn (Get $get) => self::isBoxNow($get) + ? 'Sent to Box Now as the order number — it must be one Box Now hasn\'t seen before.' + : 'Sent to the carrier and printed on the voucher — also how you find it in the carrier\'s lists.') + ->visible(! $order), + CheckboxList::make('services') + ->label('Extra services') + ->options(fn (Get $get) => self::extraServices($get('carrier'))) + ->visible(fn (Get $get) => self::extraServices($get('carrier')) !== []) + ->columns(2) + ->live() + ->columnSpanFull(), + TextInput::make('insurance_amount') + ->label('Insured value') + ->numeric() + ->minValue(0) + ->prefix('€') + ->default($default('insurance_amount')) + ->visible(fn (Get $get) => self::ticked($get, ExtraService::Insurance)) + ->required(fn (Get $get) => self::ticked($get, ExtraService::Insurance)), + TimePicker::make('delivery_until') + ->label('Deliver by') + ->seconds(false) + ->visible(fn (Get $get) => self::ticked($get, ExtraService::TimedDelivery)) + ->required(fn (Get $get) => self::ticked($get, ExtraService::TimedDelivery)), + ]), + ]; + } + + /** + * The recipient as the form has it. + */ + public static function recipient(array $data): VoucherRecipient + { + $text = fn (string $key) => filled($data[$key] ?? null) ? trim($data[$key]) : null; + + return new VoucherRecipient( + name: trim($data['name']), + address: (string) $text('address'), + postcode: preg_replace('/\s+/', '', (string) $text('postcode')), + city: (string) $text('city'), + phone: $text('phone'), + mobile: $text('mobile'), + notes: $text('notes'), + email: $text('email'), + ); + } + + /** + * The shipment request as the form has it. $cod is the cash to collect + * (null = prepaid); for an order it comes from the order, not the form. + */ + public static function request(array $data, ?float $cod, ?VoucherRecipient $recipient = null): ShipmentRequest + { + $services = array_map(fn (string $value) => ExtraService::from($value), $data['services'] ?? []); + $dimensions = array_values(array_filter([$data['length'] ?? null, $data['width'] ?? null, $data['height'] ?? null], 'filled')); + + return new ShipmentRequest( + weight: filled($data['weight'] ?? null) ? (float) $data['weight'] : null, + packageCount: (int) ($data['package_count'] ?? 1), + destinationLocationId: filled($data['locker_id'] ?? null) ? trim($data['locker_id']) : null, + paymentMode: $cod ? 'cod' : 'prepaid', + amountToCollect: $cod, + boxes: collect($data['boxes'] ?? [])->pluck('size')->all(), + services: $services, + insuranceAmount: in_array(ExtraService::Insurance, $services, true) ? (float) $data['insurance_amount'] : null, + deliveryUntil: in_array(ExtraService::TimedDelivery, $services, true) ? ($data['delivery_until'] ?? null) : null, + envelope: ($data['type'] ?? 'parcel') === 'envelope', + // All three or none — a partial set is ignored. + dimensions: count($dimensions) === 3 ? $dimensions : null, + value: filled($data['value'] ?? null) ? (float) $data['value'] : null, + recipient: $recipient, + ); + } + + /** + * Whether an order's Create Shipment uses this form: its carrier can + * take a recipient from it. + */ + public static function handles(?string $carrier): bool + { + return $carrier !== null && app(CarrierFulfillmentInterface::class, ['carrier' => $carrier]) instanceof CreatesStandaloneVouchers; + } + + /** + * @return array carrier => name, for carriers that can create vouchers without an order + */ + public static function carriers(): array + { + return collect(Shipping::getSupportedDrivers()) + ->filter(fn ($driver, string $carrier) => self::handles($carrier)) + ->map(fn ($driver) => $driver->name()) + ->all(); + } + + /** + * @return array field => default, from the order + */ + private static function defaultsFor(Order $order, ?string $carrier): array + { + $address = $order->shippingAddress; + $recipient = VoucherRecipient::fromAddress($address); + $isBoxNow = BoxNowShipping::isDriver($carrier); + + return [ + ...$recipient->toArray(), + // One number on the order: Box Now texts it, ELTA sorts + // landlines from mobiles itself. + 'phone' => $isBoxNow ? null : $recipient->phone, + 'mobile' => $isBoxNow ? $recipient->phone : null, + 'locker_id' => $address?->meta['box_now_locker']['locationId'] ?? null, + 'package_count' => 1, + 'weight' => round(WeightCalculator::totalKg($order->lines), 2) ?: 0.5, + 'cod_amount' => app(OrderStatusFlow::class)->isCod($order) ? number_format($order->total->decimal, 2, '.', '') : null, + 'insurance_amount' => $order->total->decimal, + ]; + } + + private static function carrierOf(Order $order): ?string + { + return app(OrderFulfillmentService::class)->carrierFor($order); + } + + /** + * @return array ExtraService value => label + */ + private static function extraServices(?string $carrier): array + { + $service = $carrier ? app(CarrierFulfillmentInterface::class, ['carrier' => $carrier]) : null; + + if (! $service instanceof SupportsExtraServices) { + return []; + } + + return collect(array_keys($service->extraServices())) + ->mapWithKeys(fn (string $value) => [$value => ExtraService::from($value)->label()]) + ->all(); + } + + private static function isBoxNow(Get $get): bool + { + return BoxNowShipping::isDriver($get('carrier')); + } + + private static function ticked(Get $get, ExtraService $service): bool + { + return in_array($service->value, $get('services') ?? [], true); + } +} diff --git a/src/Shipping/Models/Shipment.php b/src/Shipping/Models/Shipment.php index f8988b1..ff10df3 100644 --- a/src/Shipping/Models/Shipment.php +++ b/src/Shipping/Models/Shipment.php @@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Lunar\Models\Order; use Lunar\Shipping\Facades\Shipping; +use Modules\Core\Shipping\DTOs\VoucherRecipient; class Shipment extends Model { @@ -51,6 +52,38 @@ class Shipment extends Model return $this->shipmentInfo()->latest('occurred_at')->first(); } + /** + * Who the voucher goes to, as saved when it was created + * (meta.recipient). Vouchers created before that was saved fall back to + * their order's shipping address; an extra parcel of a multi-parcel + * send falls back to its main voucher's. + */ + public function recipient(): ?VoucherRecipient + { + if (filled($this->meta['recipient'] ?? null)) { + return VoucherRecipient::fromArray((array) $this->meta['recipient']); + } + + if ($address = $this->order?->shippingAddress) { + return VoucherRecipient::fromAddress($address); + } + + $masterId = $this->meta['master_shipment_id'] ?? null; + + return $masterId ? self::find($masterId)?->recipient() : null; + } + + /** + * The reference we sent the carrier with this voucher (saved since + * 0.29.2); older vouchers were sent their order's reference. + */ + public function reference(): ?string + { + return filled($this->meta['reference'] ?? null) + ? (string) $this->meta['reference'] + : $this->order?->reference; + } + /** * The carrier's display name: a manual carrier's own name (snapshotted * from its shipping method), otherwise the shipping driver's name(). @@ -135,6 +168,11 @@ class Shipment extends Model */ public function parcelDescription(): ?string { + // Box Now: every box is its own voucher (no main voucher). + if (($this->meta['boxes'] ?? 0) > 1) { + return "Box {$this->meta['box']} of {$this->meta['boxes']}"; + } + $piece = $this->meta['piece'] ?? null; $pieces = $this->meta['pieces'] ?? null;