• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/onec/documentimport.php
  • Класс: BitrixSaleExchangeOneCDocumentImport
  • Вызов: DocumentImport::resolveDocumentTypeId
static function resolveDocumentTypeId(array $document)
    {
        $typeId = DocumentType::UNDEFINED;

        $message = self::getMessage();

        $operation = $document['#'][$message['CC_BSC1_OPERATION']][0]['#'];
        if(!empty($operation))
        {
            if($operation == $message["CC_BSC1_ORDER"])
            {
                $typeId = DocumentType::ORDER;
            }
            elseif($operation == $message["CC_BSC1_PAYMENT_C"])
            {
                $typeId = DocumentType::PAYMENT_CASH;
            }
            elseif($operation == $message["CC_BSC1_PAYMENT_B"])
            {
                $typeId = DocumentType::PAYMENT_CASH_LESS;
            }
            elseif($operation == $message["CC_BSC1_PAYMENT_A"])
            {
                $typeId = DocumentType::PAYMENT_CARD_TRANSACTION;
            }
            elseif($operation == $message["CC_BSC1_SHIPMENT"])
            {
                $typeId = DocumentType::SHIPMENT;
            }
            else
                $typeId = DocumentType::UNDEFINED;
        }

        return $typeId;
    }