25 public static function getShipmentEditLink($shipmentId, $text =
'', $orderId = 0, $languageId = LANGUAGE_ID)
28 $text = strval($shipmentId);
30 if(intval($orderId) <= 0)
32 $res = Internals\ShipmentTable::getList(array(
36 'select' => array(
'ID',
'ORDER_ID')
39 if($row = $res->fetch())
40 $orderId = $row[
'ORDER_ID'];
43 return '<a href="/bitrix/admin/sale_order_shipment_edit.php'.
44 '?order_id='.intval($orderId).
45 '&shipment_id='.intval($shipmentId).
46 '&lang='.htmlspecialcharsbx($languageId).
48 htmlspecialcharsbx($text).
58 public static function getDeliveryEditLink($deliveryId, $deliveryName =
'', $languageId = LANGUAGE_ID)
60 if($deliveryName ==
'')
62 $delivery = Services\Manager::getObjectById($deliveryId);
63 $deliveryName = !!$delivery ? $delivery->getNameWithParent().
' ['.intval($deliveryId).
']' : intval($deliveryId);
66 return '<a href="/bitrix/admin/sale_delivery_service_edit.php'.
67 '?ID='.intval($deliveryId).
68 '&lang='.htmlspecialcharsbx($languageId).
70 htmlspecialcharsbx($deliveryName).
83 $text = strval($requestId);
85 return '<a href="/bitrix/admin/sale_delivery_request_view.php'.
86 '?ID='.intval($requestId).
87 '&lang='.htmlspecialcharsbx($languageId).
89 htmlspecialcharsbx($text).
99 public static function getShipmentsByIds(array $shipmentIds)
101 if(empty($shipmentIds))
104 $registry = Sale\Registry::getInstance(
Sale\Registry::REGISTRY_TYPE_ORDER);
106 $orderClass = $registry->getOrderClassName();
110 $res = Internals\ShipmentTable::getList(array(
112 '=ID' => $shipmentIds
114 'select' => array(
'ID',
'ORDER_ID')
117 while($shp = $res->fetch())
119 $order = $orderClass::load($shp[
'ORDER_ID']);
121 foreach($order->getShipmentCollection() as $shipment)
123 if($shp[
'ID'] != $shipment->getId())
126 if(!in_array($shp[
'ID'], $shipmentIds))
129 $result[$shp[
'ID']] = $shipment;
143 $deliveryRequest = RequestTable::getByPrimary(
146 'select' => [
'*',
'SHIPMENTS']
150 if (is_null($deliveryRequest))
157 foreach ($deliveryRequest->getShipments() as $requestShipment)
159 $shipment = ShipmentRepository::getInstance()->getById(
160 $requestShipment->getShipmentId()
163 $result[] = $shipment;