• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/onec/converterdocument.php
  • Класс: BitrixSaleExchangeOneCConverterDocumentShipment
  • Вызов: ConverterDocumentShipment::sanitizeFields
public function sanitizeFields($shipment=null, array &$fields)
    {
        if(!empty($shipment) && !($shipment instanceof Shipment))
            throw new ArgumentException("Entity must be instanceof Shipment");

        foreach($fields as $k=>$v)
        {
            switch($k)
            {
                case 'BASE_PRICE_DELIVERY':
                    if((!empty($shipment)? $shipment->getPrice():'') != $v)
                    {
                        $fields['CURRENCY'] = $this->settings->getCurrency();
                        $fields['CUSTOM_PRICE_DELIVERY'] = "Y";
                    }
                    else
                    {
                        unset($fields['BASE_PRICE_DELIVERY']);
                    }
                    break;
			case 'DELIVERY_ID':
				if(!empty($shipment))
				{
					unset($fields['DELIVERY_ID']);
				}
				break;
            }
        }
        unset($fields['ID']);
    }