feat: Enhance InPost service selection and handling in Allegro settings
- Added a check for available InPost services and display a message if none are found. - Updated the InPost service selection dropdown to include additional data attributes for better handling in JavaScript. - Improved JavaScript event handling for InPost service selection to correctly populate hidden fields with selected service data. feat: Introduce Cash on Delivery (COD) functionality in shipment preparation - Added a new input field for specifying the COD amount and currency in the shipment preparation view. - Updated the shipment creation logic to handle COD amounts correctly when creating shipments. refactor: Update OrdersController to include shipment package repository - Modified the OrdersController to accept a ShipmentPackageRepository for better management of shipment-related data. - Enhanced order details to include shipment package information. fix: Ensure internal order numbers are generated upon order creation - Updated the OrderImportRepository to generate and store internal order numbers when a new order is created. feat: Implement status synchronization for Allegro orders - Introduced a new service for syncing order statuses from Allegro to the internal system. - Added logic to fetch and process orders needing status updates, handling errors gracefully. chore: Clean up InPost service definitions in AllegroIntegrationController - Removed hardcoded InPost service definitions and replaced them with dynamic fetching based on available services. feat: Add activity logging for shipment actions - Implemented activity logging for various shipment actions, including creation, label downloads, and errors, to improve traceability and auditing.
This commit is contained in:
@@ -368,12 +368,10 @@ final class AllegroOrderImportService
|
||||
$pickupAddress = is_array($pickupPoint['address'] ?? null) ? $pickupPoint['address'] : [];
|
||||
if ($deliveryAddress !== [] || $pickupAddress !== []) {
|
||||
$isPickupPointDelivery = $pickupAddress !== [];
|
||||
$name = $isPickupPointDelivery
|
||||
? $this->nullableString((string) ($pickupPoint['name'] ?? ''))
|
||||
: $this->fallbackName($deliveryAddress, 'Dostawa');
|
||||
if ($name === null) {
|
||||
$name = 'Dostawa';
|
||||
}
|
||||
|
||||
// Always use recipient's personal data from delivery.address for name/phone/email.
|
||||
// For pickup points, delivery.address still holds the recipient's data (not the machine location).
|
||||
$name = $this->fallbackName($deliveryAddress, 'Dostawa');
|
||||
|
||||
$street = $isPickupPointDelivery
|
||||
? $this->nullableString((string) ($pickupAddress['street'] ?? ''))
|
||||
@@ -388,10 +386,13 @@ final class AllegroOrderImportService
|
||||
? $this->nullableString((string) ($pickupAddress['countryCode'] ?? ''))
|
||||
: $this->nullableString((string) ($deliveryAddress['countryCode'] ?? ''));
|
||||
|
||||
$deliveryPhone = trim((string) ($deliveryAddress['phoneNumber'] ?? ''));
|
||||
$buyerPhone = trim((string) ($buyer['phoneNumber'] ?? ''));
|
||||
|
||||
$result[] = [
|
||||
'address_type' => 'delivery',
|
||||
'name' => $name,
|
||||
'phone' => $this->nullableString((string) ($deliveryAddress['phoneNumber'] ?? '')),
|
||||
'phone' => $this->nullableString($deliveryPhone !== '' ? $deliveryPhone : $buyerPhone),
|
||||
'email' => $this->nullableString((string) ($deliveryAddress['email'] ?? $buyer['email'] ?? '')),
|
||||
'street_name' => $street,
|
||||
'street_number' => null,
|
||||
|
||||
Reference in New Issue
Block a user