21 return Loc::getMessage(
'SALE_SRV_RSTR_BY_TRADE_BINDING_NAME');
29 return Loc::getMessage(
'SALE_SRV_RSTR_BY_TRADE_BINDING_DESC');
44 "TRADE_BINDING" =>
array(
47 "LABEL" => Loc::getMessage(
"SALE_SRV_RSTR_BY_TRADE_BINDING_LIST"),
48 "OPTIONS" => self::getTradePlatformList()
61 protected static function getTradePlatformList()
65 $dbRes = Sale\TradingPlatformTable::getList([
'select' => [
'CODE',
'CLASS']]);
69 $platformClassName =
$data[
'CLASS'];
71 if (!empty($platformClassName) && class_exists($platformClassName))
95 protected static function extractParams(Sale\Internals\Entity
$entity)
106 $collection =
$order->getTradeBindingCollection();
109 foreach ($collection as
$entity)
111 $tradeBinding =
$entity->getTradePlatform();
114 && !in_array($tradeBinding->getId(),
$result)
117 $result[] = $tradeBinding->getId();
128 protected static function getOrder(Sale\Internals\Entity
$entity)
130 if (
$entity instanceof Sale\Shipment)
133 $collection =
$entity->getCollection();
136 return $collection->getOrder();
155 if (is_array($restrictionParams) && isset($restrictionParams[
'TRADE_BINDING']))
157 $diff = array_diff(
$params, $restrictionParams[
'TRADE_BINDING']);
174 return count(static::getTradePlatformList()) > 0;
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)