2namespace Bitrix\Sale\Services\PaySystem\Restrictions;
4use Bitrix\Main\Localization\Loc;
5use Bitrix\Sale\Delivery\Services;
6use Bitrix\Sale\Internals\CollectableEntity;
7use Bitrix\Sale\Internals\DeliveryPaySystemTable;
8use Bitrix\Sale\Internals\Entity;
10use Bitrix\Sale\Payment;
11use Bitrix\Sale\PaymentCollection;
12use Bitrix\Sale\Services\Base\Restriction;
13use Bitrix\Sale\Services\Base\RestrictionManager;
14use Bitrix\Sale\ShipmentCollection;
16Loc::loadMessages(__FILE__);
32 return Loc::getMessage(
"SALE_SRV_RSTR_BY_DELIVERY_NAME");
40 return Loc::getMessage(
"SALE_SRV_RSTR_BY_DELIVERY_DESC");
45 return Loc::getMessage(
'SALE_SRV_RSTR_BY_DELIVERY_ON_APPLY_ERROR_MSG');
56 if(intval($serviceId) <= 0)
62 $deliveries = self::getDeliveryByPaySystemsId($serviceId);
64 if(empty($deliveries))
67 $diff = array_diff(
$params, $deliveries);
78 $shipmentCollection =
null;
90 $shipmentCollection =
$order->getShipmentCollection();
95 $shipmentCollection =
$entity->getShipmentCollection();
98 if ($shipmentCollection)
101 foreach ($shipmentCollection as $shipment)
103 if (!$shipment->isSystem())
105 $deliveryId = $shipment->getDeliveryId();
125 $serviceList =
array();
126 $dbRes = Services\Table::getList(
array(
'select' =>
array(
'ID',
'NAME',
'PARENT_ID',
'CLASS_NAME')));
132 if (is_callable(
$service[
'CLASS_NAME'].
'::canHasChildren') &&
$service[
'CLASS_NAME']::canHasChildren())
135 if ((
int)
$service[
'PARENT_ID'] > 0 && array_key_exists(
$service[
'PARENT_ID'], $serviceList))
137 $parentService = $serviceList[
$service[
'PARENT_ID']];
139 if (is_callable($parentService[
'CLASS_NAME'].
'::canHasChildren') && $parentService[
'CLASS_NAME']::canHasChildren())
165 "LABEL" => Loc::getMessage(
"SALE_SRV_RSTR_BY_DELIVERY_PRM_PS"),
166 "OPTIONS" => self::getDeliveryServiceList()
180 if ($paySystemId == 0)
183 $result = DeliveryPaySystemTable::getLinks($paySystemId, DeliveryPaySystemTable::ENTITY_TYPE_PAYSYSTEM, self::$preparedData);
196 if(intval($paySystemId) <= 0)
201 DeliveryPaySystemTable::setLinks(
203 DeliveryPaySystemTable::ENTITY_TYPE_PAYSYSTEM,
237 return array(
"DELIVERY" => self::getDeliveryByPaySystemsId(
$entityId));
247 public static function delete($restrictionId,
$entityId = 0)
249 DeliveryPaySystemTable::setLinks(
251 DeliveryPaySystemTable::ENTITY_TYPE_PAYSYSTEM,
256 return parent::delete($restrictionId);
265 if(empty($servicesIds))
268 self::$preparedData = DeliveryPaySystemTable::prepareData($servicesIds, DeliveryPaySystemTable::ENTITY_TYPE_PAYSYSTEM);
static prepareParamsValues(array $paramsValues, $entityId=0)
static getDeliveryServiceList()
static check($params, array $restrictionParams, $serviceId=0)
static prepareParamsForSaving(array $params=array(), $paySystemId=0)
static save(array $fields, $restrictionId=0)
static prepareData(array $servicesIds)
static getClassDescription()
static getOnApplyErrorMessage()
static getDeliveryByPaySystemsId($paySystemId=0)
static getParamsStructure($entityId=0)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']