Skip to content

Commit

Permalink
My 29604 use region (#58)
Browse files Browse the repository at this point in the history
* feat: possibility to export a region
  • Loading branch information
RichardPerdaan authored Nov 8, 2021
1 parent 6f084a7 commit 90f119d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/Factory/Consignment/ConsignmentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ private function setRecipient(): void
->setFullStreet($this->orderData['full_street'])
->setPostalCode($this->orderData['postcode'])
->setCity($this->orderData['city'])
->setRegion($this->orderData['state_name'])
->setEmail($this->getEmailConfiguration())
->setPhone($this->getPhoneConfiguration())
->setSaveRecipientAddress(false);
Expand Down Expand Up @@ -392,10 +393,6 @@ private function setCustomItems(): void
$description = $product['product_name'];
$itemValue = Tools::ps_round($product['unit_price_tax_incl'] * 100);

if (strlen($description) > Constant::ITEM_DESCRIPTION_MAX_LENGTH) {
$description = substr_replace($description, '...', Constant::ITEM_DESCRIPTION_MAX_LENGTH - 3);
}

$this->consignment->addItem(
(new MyParcelCustomsItem())
->setDescription($description)
Expand Down
6 changes: 4 additions & 2 deletions src/Model/OrderLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,9 @@ public static function getDataForLabelsCreate(array $orderIds)
orders.id_order AS id,
orders.reference,
country.iso_code,
CONCAT(address.firstname, " ",address.lastname) as person,
CONCAT(address.address1, " ", address.address2) as full_street,
state.name AS state_name,
CONCAT(address.firstname, " ",address.lastname) AS person,
CONCAT(address.address1, " ", address.address2) AS full_street,
address.postcode,
address.city,
customer.email,
Expand All @@ -331,6 +332,7 @@ public static function getDataForLabelsCreate(array $orderIds)
$qb->innerJoin('address', 'address', 'orders.id_address_delivery = address.id_address');
$qb->innerJoin('country', 'country', 'country.id_country = address.id_country');
$qb->innerJoin('customer', 'customer', 'orders.id_customer = customer.id_customer');
$qb->leftJoin('state', 'state', 'state.id_state = address.id_state');
$qb->leftJoin(Table::TABLE_DELIVERY_SETTINGS, 'delivery_settings', 'orders.id_cart = delivery_settings.id_cart');

$qb->where('id_order IN (' . implode(',', $orderIds) . ') ');
Expand Down

0 comments on commit 90f119d

Please sign in to comment.