Пример #1
0
                ?>
							<script language="JavaScript">
								window.open('<?php 
                echo $arParams["PATH_TO_PAYMENT"];
                ?>
?ORDER_ID=<?php 
                echo $arResult["ORDER_BASKET"]["ORDER_ID"];
                ?>
');
							</script>
							<?php 
                echo GetMessage("SOA_TEMPL_PAY_LINK", array("#LINK#" => $arParams["PATH_TO_PAYMENT"] . "?ORDER_ID=" . $arResult["ORDER_BASKET"]["ORDER_ID"]));
                ?>
							<?php 
            } else {
                $service = \Bitrix\Sale\PaySystem\Manager::getObjectById($arResult['PAY_SYSTEM_ID']);
                if ($service) {
                    $orderId = $arResult['ORDER_ID'];
                    /** @var \Bitrix\Sale\Order $order */
                    $order = \Bitrix\Sale\Order::load($orderId);
                    if ($order === null) {
                        $data = \Bitrix\Sale\Internals\OrderTable::getRow(array('select' => array('ID'), 'filter' => array('ACCOUNT_NUMBER' => $orderId)));
                        $order = \Bitrix\Sale\Order::load($data['ID']);
                    }
                    /** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
                    $paymentCollection = $order->getPaymentCollection();
                    /** @var \Bitrix\Sale\Payment $payment */
                    foreach ($paymentCollection as $payment) {
                        if (!$payment->isInner()) {
                            $context = \Bitrix\Main\Application::getInstance()->getContext();
                            $service->initiatePay($payment, $context->getRequest());
Пример #2
0
 /**
  * Function gets pay system info from database, no cache is used here
  * @return void
  */
 protected function obtainDataPaySystem()
 {
     if (empty($this->dbResult["ID"])) {
         return;
     }
     foreach ($this->dbResult['PAYMENT'] as &$payment) {
         if (intval($payment["PAY_SYSTEM_ID"])) {
             $payment["PAY_SYSTEM"] = \Bitrix\Sale\PaySystem\Manager::getById($payment["PAY_SYSTEM_ID"]);
             $payment["PAY_SYSTEM"]['NAME'] = htmlspecialcharsbx($payment["PAY_SYSTEM"]['NAME']);
         }
         if ($payment["PAID"] != "Y" && $this->dbResult["CANCELED"] != "Y") {
             $payment['BUFFERED_OUTPUT'] = '';
             $payment['ERROR'] = '';
             $service = new \Bitrix\Sale\PaySystem\Service($payment["PAY_SYSTEM"]);
             if ($service) {
                 $payment["CAN_REPAY"] = "Y";
                 if ($service->getField("NEW_WINDOW") == "Y") {
                     $payment["PAY_SYSTEM"]["PSA_ACTION_FILE"] = htmlspecialcharsbx($this->arParams["PATH_TO_PAYMENT"]) . '?ORDER_ID=' . urlencode(urlencode($this->dbResult["ACCOUNT_NUMBER"])) . '&PAYMENT_ID=' . $payment['ID'];
                 } else {
                     CSalePaySystemAction::InitParamArrays($this->dbResult, $this->requestData["ID"], '', array(), $payment);
                     // for compatibility
                     $actionFile = $service->getField('ACTION_FILE');
                     $map = CSalePaySystemAction::getOldToNewHandlersMap();
                     $oldHandler = array_search($actionFile, $map);
                     if ($oldHandler !== false && !$service->isCustom()) {
                         $actionFile = $oldHandler;
                     }
                     $pathToAction = Main\Application::getDocumentRoot() . $actionFile;
                     $pathToAction = str_replace("\\", "/", $pathToAction);
                     while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
                         $pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
                     }
                     if (file_exists($pathToAction)) {
                         if (is_dir($pathToAction) && file_exists($pathToAction . "/payment.php")) {
                             $pathToAction .= "/payment.php";
                         }
                         $payment["PAY_SYSTEM"]["PSA_ACTION_FILE"] = $pathToAction;
                     }
                     $encoding = $service->getField("ENCODING");
                     if (strlen($encoding) > 0) {
                         define("BX_SALE_ENCODING", $encoding);
                         AddEventHandler("main", "OnEndBufferContent", array($this, "changeBodyEncoding"));
                     }
                     /** @var \Bitrix\Sale\Order $order */
                     $order = \Bitrix\Sale\Order::load($this->dbResult["ID"]);
                     if ($order) {
                         /** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
                         $paymentCollection = $order->getPaymentCollection();
                         if ($paymentCollection) {
                             /** @var \Bitrix\Sale\Payment $paymentItem */
                             $paymentItem = $paymentCollection->getItemById($payment['ID']);
                             if ($paymentItem) {
                                 $initResult = $service->initiatePay($paymentItem, null, \Bitrix\Sale\PaySystem\BaseServiceHandler::STRING);
                                 if ($initResult->isSuccess()) {
                                     $payment['BUFFERED_OUTPUT'] = $initResult->getTemplate();
                                 } else {
                                     $payment['ERROR'] = implode('\\n', $initResult->getErrorMessages());
                                 }
                             }
                         }
                     }
                 }
                 $payment["PAY_SYSTEM"]["PSA_NEW_WINDOW"] = $payment["PAY_SYSTEM"]["NEW_WINDOW"];
             }
         }
     }
     unset($payment);
     // for compatibility
     $this->dbResult['PAY_SYSTEM'] = $this->dbResult['PAYMENT'][0]['PAY_SYSTEM'];
     $this->dbResult['CAN_REPAY'] = $this->dbResult['PAYMENT'][0]['CAN_REPAY'];
 }
Пример #3
0
        if ($data) {
            BusinessValue::addConsumer($consumer, $data);
        }
    }
    $businessValueControl->renderMap(array('CONSUMER_KEY' => $consumer));
} elseif ($id > 0) {
    $businessValueControl->renderMap(array('CONSUMER_KEY' => 'PAYSYSTEM_' . $id));
}
?>
		</td>
	</tr>
	<tbody id="pay_system_tariff">
		<?php 
$actionFile = $request->get('ACTION_FILE') ? $request->get('ACTION_FILE') : $paySystem['ACTION_FILE'];
$tariffBlock = '';
$tariff = PaySystem\Manager::getTariff($actionFile, $paySystem['ID']);
if ($tariff) {
    $tariffBlock = '<tr class="heading"><td align="center" colspan="2">' . Loc::getMessage('SALE_PS_TARIFF') . '</td></tr>';
    $arMultiControlQuery = array();
    foreach ($tariff as $fieldId => $arField) {
        if (!empty($arMultiControlQuery) && (!isset($arField['MCS_ID']) || !array_key_exists($arField['MCS_ID'], $arMultiControlQuery))) {
            $tariffBlock .= CSaleHelper::getAdminMultilineControl($arMultiControlQuery);
            $arMultiControlQuery = array();
        }
        $controlHtml = CSaleHelper::getAdminHtml($fieldId, $arField, 'TARIF', 'pay_sys_form');
        if ($arField["TYPE"] == 'MULTI_CONTROL_STRING') {
            $arMultiControlQuery[$arField['MCS_ID']]['CONFIG'] = $arField;
            continue;
        } elseif (isset($arField['MCS_ID'])) {
            $arMultiControlQuery[$arField['MCS_ID']]['ITEMS'][] = $controlHtml;
            continue;
Пример #4
0
CCurrencyLang::disableUseHideZero();
$orderId = (int) $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"];
if ($orderId) {
    /** @var \Bitrix\Sale\Order $order */
    $order = \Bitrix\Sale\Order::load($orderId);
    if ($order) {
        /** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
        $paymentCollection = $order->getPaymentCollection();
        if ($paymentCollection) {
            /** @var \Bitrix\Sale\Payment $payment */
            foreach ($paymentCollection as $payment) {
                if (!$payment->isInner()) {
                    break;
                }
            }
            if ($payment) {
                $context = \Bitrix\Main\Application::getInstance()->getContext();
                $service = \Bitrix\Sale\PaySystem\Manager::getObjectById($payment->getPaymentSystemId());
                if ($_REQUEST['pdf'] && $_REQUEST['GET_CONTENT'] == 'Y') {
                    $result = $service->initiatePay($payment, $context->getRequest(), \Bitrix\Sale\PaySystem\BaseServiceHandler::STRING);
                    if ($result->isSuccess()) {
                        return $result->getTemplate();
                    }
                }
                $result = $service->initiatePay($payment, $context->getRequest());
            }
            CCurrencyLang::enableUseHideZero();
        }
    }
}
Пример #5
0
 /**
  * Modify payment collection.
  *
  * @param string $action			Action.
  * @param Payment $payment			Payment.
  * @param null|string $name				Field name.
  * @param null|string|int|float $oldValue		Old value.
  * @param null|string|int|float $value			New value.
  * @return Result
  * @throws Main\ArgumentOutOfRangeException
  * @throws Main\NotImplementedException
  * @throws Main\ObjectNotFoundException
  */
 public function onPaymentCollectionModify($action, Payment $payment, $name = null, $oldValue = null, $value = null)
 {
     $result = new Result();
     if ($action == EventActions::DELETE) {
         if ($this->getField('PAY_SYSTEM_ID') == $payment->getPaymentSystemId()) {
             /** @var PaymentCollection $paymentCollection */
             if (!($paymentCollection = $payment->getCollection())) {
                 throw new Main\ObjectNotFoundException('Entity "PaymentCollection" not found');
             }
             /** @var Payment $entityPayment */
             foreach ($paymentCollection as $entityPayment) {
                 if (intval($entityPayment->getField('PAY_SYSTEM_ID')) > 0 && intval($entityPayment->getField('PAY_SYSTEM_ID')) != $payment->getPaymentSystemId()) {
                     $this->setFieldNoDemand('PAY_SYSTEM_ID', $entityPayment->getField('PAY_SYSTEM_ID'));
                     break;
                 }
             }
         }
     }
     if ($action != EventActions::UPDATE) {
         return $result;
     }
     if ($name == "CURRENCY" && $value != $this->getField("CURRENCY")) {
         throw new Main\NotImplementedException();
     }
     if ($name == "SUM" || $name == "PAID") {
         if ($this->isCanceled()) {
             $result->addError(new ResultError(Loc::getMessage('SALE_ORDER_PAID_ORDER_CANCELED'), 'SALE_ORDER_PAID_ORDER_CANCELED'));
             return $result;
         }
         if ($name == "SUM" && !$payment->isPaid()) {
             if ($value == 0 && $payment->isInner()) {
                 $payment->delete();
             }
             return $result;
         }
         $r = $this->syncOrderAndPayments($payment);
         if (!$r->isSuccess()) {
             $result->addErrors($r->getErrors());
         }
     } elseif ($name == "IS_RETURN") {
         if ($this->isCanceled()) {
             $result->addError(new ResultError(Loc::getMessage('SALE_ORDER_RETURN_ORDER_CANCELED'), 'SALE_ORDER_RETURN_ORDER_CANCELED'));
             return $result;
         }
         if ($value != Payment::RETURN_NONE) {
             if (!$payment->isPaid()) {
                 $result->addError(new ResultError(Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_NOT_PAID'), 'SALE_ORDER_PAYMENT_RETURN_NOT_PAID'));
                 return $result;
             }
             $oldPaid = $this->isPaid() ? "Y" : "N";
             /** @var PaymentCollection $paymentCollection */
             if (!($paymentCollection = $this->getPaymentCollection())) {
                 throw new Main\ObjectNotFoundException('Entity "PaymentCollection" not found');
             }
             $creditSum = 0;
             $overPaid = $paymentCollection->getPaidSum() - $this->getPrice();
             if ($overPaid <= 0) {
                 $creditSum = $payment->getSum();
                 $overPaid = 0;
             } elseif ($payment->getSum() - $overPaid > 0) {
                 $creditSum = $payment->getSum() - $overPaid;
             }
             if ($value == Payment::RETURN_PS) {
                 $psId = $payment->getPaymentSystemId();
             } elseif ($value == Payment::RETURN_INNER) {
                 $psId = Manager::getInnerPaySystemId();
             } else {
                 $result->addError(new Entity\EntityError('unsupported operation'));
                 return $result;
             }
             $service = Manager::getObjectById($psId);
             if ($service && $service->isRefundable()) {
                 if ($creditSum) {
                     if ($value == Payment::RETURN_PS) {
                         if ($overPaid > 0) {
                             $userBudget = Internals\UserBudgetPool::getUserBudgetByOrder($this);
                             if (PriceMaths::roundByFormatCurrency($overPaid, $this->getCurrency()) > PriceMaths::roundByFormatCurrency($userBudget, $this->getCurrency())) {
                                 $result->addError(new Entity\EntityError(Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_PAID')));
                                 return $result;
                             }
                         }
                     }
                     $refResult = $service->refund($payment);
                     if ($refResult->isSuccess()) {
                         if ($overPaid > 0) {
                             Internals\UserBudgetPool::addPoolItem($this, -$overPaid, Internals\UserBudgetPool::BUDGET_TYPE_ORDER_PAY, $payment);
                         }
                     } else {
                         $result->addErrors($refResult->getErrors());
                         return $result;
                     }
                 }
             } else {
                 $result->addError(new Entity\EntityError(Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_NO_SUPPORTED')));
                 return $result;
             }
             $payment->setFieldNoDemand('PAID', 'N');
             $finalSumPaid = $this->getSumPaid() - $creditSum;
             if ($finalSumPaid != $this->getSumPaid()) {
                 $this->setFieldNoDemand('SUM_PAID', $finalSumPaid);
                 $this->setFieldNoDemand('PAYED', $this->getPrice() <= $finalSumPaid ? "Y" : "N");
             }
             /** @var Result $r */
             $r = $this->onAfterSyncPaid($oldPaid);
             if (!$r->isSuccess()) {
                 $result->addErrors($r->getErrors());
             }
         } else {
             if ($payment->isPaid()) {
                 $result->addError(new ResultError(Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_PAID'), 'SALE_ORDER_PAYMENT_RETURN_PAID'));
                 return $result;
             }
             $userBudget = Internals\UserBudgetPool::getUserBudgetByOrder($this);
             if (PriceMaths::roundByFormatCurrency($userBudget, $this->getCurrency()) < PriceMaths::roundByFormatCurrency($payment->getSum(), $this->getCurrency())) {
                 $result->addError(new ResultError(Loc::getMessage('SALE_ORDER_PAYMENT_NOT_ENOUGH_USER_BUDGET'), "SALE_ORDER_PAYMENT_NOT_ENOUGH_USER_BUDGET"));
                 return $result;
             }
             Internals\UserBudgetPool::addPoolItem($this, $payment->getSum() * -1, Internals\UserBudgetPool::BUDGET_TYPE_ORDER_PAY, $payment);
             $r = $payment->setField('PAID', "Y");
             if (!$r->isSuccess()) {
                 $result->addErrors($r->getErrors());
                 return $result;
             }
         }
     } elseif ($name == "PAY_SYSTEM_ID") {
         if ($payment->getField('PAY_SYSTEM_ID') != $this->getField('PAY_SYSTEM_ID')) {
             $this->setFieldNoDemand('PAY_SYSTEM_ID', $payment->getField('PAY_SYSTEM_ID'));
         }
     } elseif ($name == "DATE_PAID") {
         if ($payment->getField('DATE_PAID') != $this->getField('DATE_PAID')) {
             $this->setFieldNoDemand('DATE_PAYED', $payment->getField('DATE_PAID'));
         }
     }
     if ($value != $oldValue) {
         $fields = $this->fields->getChangedValues();
         if (!array_key_exists("UPDATED_1C", $fields)) {
             parent::setField("UPDATED_1C", "N");
         }
     }
     return $result;
 }
 function Add($fields)
 {
     if (\Bitrix\Main\Config\Option::get('main', '~sale_paysystem_converted') == 'Y') {
         if (!CSalePaySystemAction::CheckFields("ADD", $fields)) {
             return false;
         }
         if (isset($fields['ACTION_FILE'])) {
             $map = self::getOldToNewHandlersMap();
             if (isset($map[$fields['ACTION_FILE']])) {
                 $fields['ACTION_FILE'] = $map[$fields['ACTION_FILE']];
             }
         }
         $fields['PSA_NAME'] = $fields['NAME'];
         if (array_key_exists("LOGOTIP", $fields) && is_array($fields["LOGOTIP"])) {
             $fields["LOGOTIP"]["MODULE_ID"] = "sale";
         }
         CFile::SaveForDB($fields, "LOGOTIP", "sale/paysystem/logotip");
         if (isset($fields['PAY_SYSTEM_ID']) && $fields['PAY_SYSTEM_ID'] > 0) {
             $dbRes = PaySystemActionTable::getById($fields['PAY_SYSTEM_ID']);
             $data = $dbRes->fetch();
             if ($data['ACTION_FILE'] != '') {
                 $result = PaySystemActionTable::add($fields);
             } else {
                 $result = PaySystemActionTable::update($fields['PAY_SYSTEM_ID'], $fields);
             }
         } else {
             $result = PaySystemActionTable::add($fields);
         }
         if ($result->isSuccess()) {
             if ($fields['PARAMS']) {
                 $params = unserialize($fields['PARAMS']);
                 if (!isset($params['BX_PAY_SYSTEM_ID'])) {
                     $params['BX_PAY_SYSTEM_ID'] = array('TYPE' => '', 'VALUE' => $result->getId());
                     PaySystemActionTable::update($result->getId(), array('PARAMS' => serialize($params)));
                     $consumers = \Bitrix\Sale\BusinessValue::getConsumers();
                     if (!isset($consumers['PAYSYSTEM_' . $result->getId()])) {
                         \Bitrix\Sale\BusinessValue::addConsumer('PAYSYSTEM_' . $result->getId(), \Bitrix\Sale\PaySystem\Manager::getHandlerDescription($fields['ACTION_FILE']));
                     } else {
                         \Bitrix\Sale\BusinessValue::changeConsumer('PAYSYSTEM_' . $result->getId(), \Bitrix\Sale\PaySystem\Manager::getHandlerDescription($fields['ACTION_FILE']));
                     }
                 }
                 $params = self::prepareParamsForBusVal($result->getId(), $fields);
                 foreach ($params as $item) {
                     \Bitrix\Sale\BusinessValue::setMapping($item['CODE'], $item['CONSUMER'], $item['PERSON_TYPE_ID'], $item['MAP']);
                 }
             }
             if (isset($fields['PERSON_TYPE_ID']) && $fields['PERSON_TYPE_ID'] > 0) {
                 $fields = array("SERVICE_ID" => $result->getId(), "SERVICE_TYPE" => \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::SERVICE_TYPE_PAYMENT, "SORT" => 100, "PARAMS" => array('PERSON_TYPE_ID' => array($fields['PERSON_TYPE_ID'])));
                 \Bitrix\Sale\Services\PaySystem\Restrictions\PersonType::save($fields);
             }
             return $result->getId();
         }
         return false;
     } else {
         global $DB;
         $arFields = $fields;
         if (!CSalePaySystemAction::CheckFields("ADD", $arFields)) {
             return false;
         }
         if (array_key_exists("LOGOTIP", $arFields) && is_array($arFields["LOGOTIP"])) {
             $arFields["LOGOTIP"]["MODULE_ID"] = "sale";
         }
         CFile::SaveForDB($arFields, "LOGOTIP", "sale/paysystem/logotip");
         $arInsert = $DB->PrepareInsert("b_sale_pay_system_action", $arFields);
         $strSql = "INSERT INTO b_sale_pay_system_action(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
         $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         $ID = IntVal($DB->LastID());
         return $ID;
     }
 }
Пример #7
0
    function OutputXmlDocument($typeDocument, $xmlResult, $document = array())
    {
        global $DB;
        ?>

	<<?php 
        echo CSaleExport::getTagName("SALE_EXPORT_DOCUMENT");
        ?>
><?php 
        switch ($typeDocument) {
            case 'Order':
                ?>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ID");
                ?>
><?php 
                echo $document["ID"];
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ID");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_NUMBER");
                ?>
><?php 
                echo self::getAccountNumberShopPrefix();
                echo $document["ACCOUNT_NUMBER"];
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_NUMBER");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_DATE");
                ?>
><?php 
                echo $DB->FormatDate($document["DATE_INSERT_FORMAT"], CSite::GetDateFormat("FULL"), "YYYY-MM-DD");
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_DATE");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_HOZ_OPERATION");
                ?>
><?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ITEM_ORDER");
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_HOZ_OPERATION");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ROLE");
                ?>
><?php 
                echo CSaleExport::getTagName("SALE_EXPORT_SELLER");
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ROLE");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY");
                ?>
><?php 
                echo htmlspecialcharsbx(strlen(self::$currency) > 0 ? substr(self::$currency, 0, 3) : substr($document["CURRENCY"], 0, 3));
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY_RATE");
                ?>
>1</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY_RATE");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_AMOUNT");
                ?>
><?php 
                echo $document["PRICE"];
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_AMOUNT");
                ?>
>
				<?php 
                if (self::getVersionSchema() > self::DEFAULT_VERSION) {
                    ?>
		<<?php 
                    echo CSaleExport::getTagName("SALE_EXPORT_VERSION");
                    ?>
><?php 
                    echo IntVal($document["VERSION"]) > 0 ? $document["VERSION"] : 0;
                    ?>
</<?php 
                    echo CSaleExport::getTagName("SALE_EXPORT_VERSION");
                    ?>
><?php 
                    if (strlen($document["ID_1C"]) > 0) {
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ID_1C");
                        ?>
><?php 
                        echo htmlspecialcharsbx($document["ID_1C"]);
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ID_1C");
                        ?>
><?php 
                    }
                }
                if (self::$crmMode) {
                    ?>
<DateUpdate><?php 
                    echo $DB->FormatDate($document["DATE_UPDATE"], CSite::GetDateFormat("FULL"), "YYYY-MM-DD HH:MI:SS");
                    ?>
</DateUpdate><?php 
                }
                echo $xmlResult['Contragents'];
                ?>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_TIME");
                ?>
><?php 
                echo $DB->FormatDate($document["DATE_INSERT_FORMAT"], CSite::GetDateFormat("FULL"), "HH:MI:SS");
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_TIME");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_COMMENTS");
                ?>
><?php 
                echo htmlspecialcharsbx($document["COMMENTS"]);
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_COMMENTS");
                ?>
>
			<?php 
                echo $xmlResult['OrderTax'];
                echo $xmlResult['OrderDiscount'];
                echo $xmlResult['SaleStore'];
                //$storeBasket = self::getXmlSaleStoreBasket($document,$arStore);
                echo $xmlResult['BasketItems'];
                echo $xmlResult['SaleProperties'];
                break;
            case 'Payment':
            case 'Shipment':
                ?>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ID");
                ?>
><?php 
                echo $document["ID"];
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ID");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_NUMBER");
                ?>
><?php 
                echo $document["ID"];
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_NUMBER");
                ?>
>
		<?php 
                switch ($typeDocument) {
                    case 'Payment':
                        ?>

		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE");
                        ?>
><?php 
                        echo $DB->FormatDate($document["DATE_BILL"], CSite::GetDateFormat("FULL"), "YYYY-MM-DD");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE");
                        ?>
>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_HOZ_OPERATION");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_PAYMENT_" . \Bitrix\Sale\PaySystem\Manager::getPsType($document['PAY_SYSTEM_ID']));
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_HOZ_OPERATION");
                        ?>
>
		<?php 
                        break;
                    case 'Shipment':
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE");
                        ?>
><?php 
                        echo $DB->FormatDate($document["DATE_INSERT"], CSite::GetDateFormat("FULL"), "YYYY-MM-DD");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE");
                        ?>
>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_HOZ_OPERATION");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_SHIPMENT");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_HOZ_OPERATION");
                        ?>
>
		<?php 
                        break;
                }
                ?>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ROLE");
                ?>
><?php 
                echo CSaleExport::getTagName("SALE_EXPORT_SELLER");
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_ROLE");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY");
                ?>
><?php 
                echo htmlspecialcharsbx(strlen(self::$currency) > 0 ? substr(self::$currency, 0, 3) : substr($document["CURRENCY"], 0, 3));
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY_RATE");
                ?>
>1</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_CURRENCY_RATE");
                ?>
>
		<?php 
                switch ($typeDocument) {
                    case 'Payment':
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_AMOUNT");
                        ?>
><?php 
                        echo $document['SUM'];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_AMOUNT");
                        ?>
>
		<?php 
                        break;
                    case 'Shipment':
                        $price = 0;
                        if (count($document['BasketResult']) > 0) {
                            foreach ($document['BasketResult'] as $basketItem) {
                                $price = $price + $basketItem['PRICE'] * $basketItem['SALE_INTERNALS_BASKET_SHIPMENT_ITEM_QUANTITY'];
                            }
                        }
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_AMOUNT");
                        ?>
><?php 
                        echo $price + intval($document['PRICE_DELIVERY']);
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_AMOUNT");
                        ?>
>
		<?php 
                        break;
                }
                ?>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_VERSION");
                ?>
><?php 
                echo IntVal($document["VERSION"]) > 0 ? $document["VERSION"] : 0;
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_VERSION");
                ?>
>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_NUMBER_BASE");
                ?>
><?php 
                echo $document['ORDER_ID'];
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_NUMBER_BASE");
                ?>
>
		<?php 
                echo $xmlResult['Contragents'];
                ?>
		<?php 
                switch ($typeDocument) {
                    case 'Payment':
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_TIME");
                        ?>
><?php 
                        echo $DB->FormatDate($document["DATE_BILL"], CSite::GetDateFormat("FULL"), "HH:MI:SS");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_TIME");
                        ?>
>
		<?php 
                        break;
                    case 'Shipment':
                        ?>
				<?php 
                        echo $xmlResult['OrderTax'];
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_TIME");
                        ?>
><?php 
                        echo $DB->FormatDate($document["DATE_INSERT"], CSite::GetDateFormat("FULL"), "HH:MI:SS");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_TIME");
                        ?>
>
		<?php 
                        break;
                }
                ?>
		<<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_COMMENTS");
                ?>
><?php 
                echo htmlspecialcharsbx($document["COMMENTS"]);
                ?>
</<?php 
                echo CSaleExport::getTagName("SALE_EXPORT_COMMENTS");
                ?>
>

		<?php 
                switch ($typeDocument) {
                    case 'Payment':
                        ?>
		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTIES_VALUES");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE_PAID");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DATE_PAID"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_CANCELED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["CANCELED"] == 'Y' ? 'true' : 'false';
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PAY_SYSTEM_ID");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["PAY_SYSTEM_ID"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PAY_SYSTEM");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["PAY_SYSTEM_NAME"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PAY_PAID");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["PAID"] == 'Y' ? 'true' : 'false';
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PAY_RETURN");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["IS_RETURN"] == 'Y' ? 'true' : 'false';
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PAY_RETURN_REASON");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["PAY_RETURN_COMMENT"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<?php 
                        self::OutputXmlSiteName($document);
                        ?>
		</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTIES_VALUES");
                        ?>
>
			<?php 
                        break;
                    case 'Shipment':
                        ?>

			<?php 
                        echo $xmlResult['BasketItems'];
                        ?>

		<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTIES_VALUES");
                        ?>
>
		    <<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PRICE_DELIVERY");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo strlen($document["PRICE_DELIVERY"]) > 0 ? $document["PRICE_DELIVERY"] : "0.0000";
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE_ALLOW_DELIVERY");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DATE_ALLOW_DELIVERY"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DELIVERY_LOCATION");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DELIVERY_LOCATION"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DELIVERY_STATUS");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["STATUS_ID"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DELIVERY_DEDUCTED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DEDUCTED"] == 'Y' ? 'true' : 'false';
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DATE_DEDUCTED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DATE_DEDUCTED"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_REASON_UNDO_DEDUCTED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["REASON_UNDO_DEDUCTED"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_RESERVED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["RESERVED"] == 'Y' ? 'true' : 'false';
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DELIVERY_ID");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DELIVERY_ID"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DELIVERY");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DELIVERY_NAME"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_CANCELED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["CANCELED"] == 'Y' ? 'true' : 'false';
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_DELIVERY_DATE_CANCEL");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["DATE_CANCELED"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo GetMessage("SALE_EXPORT_CANCEL_REASON");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["REASON_CANCELED"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
><?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_REASON_MARKED");
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_ITEM_NAME");
                        ?>
>
				<<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
><?php 
                        echo $document["REASON_MARKED"];
                        ?>
</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_VALUE");
                        ?>
>
			</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTY_VALUE");
                        ?>
>
			<?php 
                        self::OutputXmlSiteName($document);
                        ?>
			<?php 
                        self::OutputXmlDeliveryAddress();
                        ?>
	</<?php 
                        echo CSaleExport::getTagName("SALE_EXPORT_PROPERTIES_VALUES");
                        ?>
>
			<?php 
                        break;
                }
        }
        ?>
	</<?php 
        echo CSaleExport::getTagName("SALE_EXPORT_DOCUMENT");
        ?>
>
	<?php 
    }
Пример #8
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("sale")) {
    return;
}
$arPaySys = array("0" => GetMessage("SOPR_CHOOSE_PC"));
$dbPaySystem = \Bitrix\Sale\PaySystem\Manager::getList(array('filter' => array('ACTIVE' => 'Y', 'HAVE_RESULT_RECEIVE' => 'Y'), 'order' => array('SORT' => 'ASC', 'PSA_NAME' => 'ASC')));
while ($paySystem = $dbPaySystem->fetch()) {
    $arPaySys[$paySystem["ID"]] = $paySystem["NAME"];
}
if (!isset($arCurrentValues["PAY_SYSTEM_ID_NEW"])) {
    $newId = \CSalePaySystem::getNewIdsFromOld($arCurrentValues["PAY_SYSTEM_ID"], $arCurrentValues['PERSON_TYPE_ID']);
    $currentValue = current($newId);
} else {
    $currentValue = $arCurrentValues["PAY_SYSTEM_ID_NEW"];
}
$arComponentParameters = array("PARAMETERS" => array("PAY_SYSTEM_ID_NEW" => array("NAME" => GetMessage("SOPR_PC"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => $arPaySys, "COLS" => 25, "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE", "DEFAULT" => $currentValue)));
Пример #9
0
:</td>
		<td>
			<?php 
$ptRes = Sale\Internals\PersonTypeTable::getList(array('order' => array("SORT" => "ASC", "NAME" => "ASC")));
$personTypes = array();
while ($personType = $ptRes->fetch()) {
    $personTypes[$personType['ID']] = $personType;
}
?>
			<select name="filter_pay_system[]" multiple size="3">
				<option value=""><?php 
echo GetMessage("SALE_F_ALL");
?>
</option>
				<?php 
$res = \Bitrix\Sale\PaySystem\Manager::getList(array('select' => array('ID', 'NAME'), 'filter' => array('ACTIVE' => 'Y'), 'order' => array("SORT" => "ASC", "NAME" => "ASC")));
$paySystemList = array();
while ($paySystem = $res->fetch()) {
    $paySystemList[$paySystem['ID']]['NAME'] = $paySystem['NAME'];
}
if ($paySystemList) {
    $dbRestRes = Sale\Services\PaySystem\Restrictions\Manager::getList(array('select' => array('SERVICE_ID', 'PARAMS'), 'filter' => array('=CLASS_NAME' => '\\Bitrix\\Sale\\Services\\PaySystem\\Restrictions\\PersonType', 'SERVICE_ID' => array_keys($paySystemList))));
    while ($ptParams = $dbRestRes->fetch()) {
        $paySystemList[$ptParams['SERVICE_ID']]['PERSON_TYPE_ID'] = $ptParams['PARAMS']['PERSON_TYPE_ID'];
    }
    foreach ($paySystemList as $psId => $paySystem) {
        $personTypeString = '';
        if ($paySystem['PERSON_TYPE_ID']) {
            $psPt = array();
            foreach ($paySystem['PERSON_TYPE_ID'] as $ptId) {
                $psPt[] = (strlen($personTypes[$ptId]['NAME']) > 15 ? substr($personTypes[$ptId]['NAME'], 0, 6) . "..." . substr($personTypes[$ptId]['NAME'], -7) : $personTypes[$ptId]['NAME']) . "/" . $personTypes[$ptId]["LID"] . "";
Пример #10
0
        $ptRes = \Bitrix\Sale\PersonTypeTable::getList(array('select' => array('NAME'), 'filter' => array('ID' => $restriction['PARAMS']['PERSON_TYPE_ID'])));
        while ($personType = $ptRes->fetch()) {
            $pTypes .= "<div>" . $personType['NAME'] . "</div>";
        }
    }
    $row->AddField("PERSON_TYPES", $pTypes);
    $dbRestriction = \Bitrix\Sale\Internals\ServiceRestrictionTable::getList(array('select' => array('PARAMS'), 'filter' => array('SERVICE_ID' => $f_ID, 'SERVICE_TYPE' => \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::SERVICE_TYPE_PAYMENT, '=CLASS_NAME' => '\\Bitrix\\Sale\\Services\\PaySystem\\Restrictions\\Site')));
    $pSite = '';
    if ($restriction = $dbRestriction->fetch()) {
        $siteRes = \Bitrix\Main\SiteTable::getList(array('select' => array('NAME', 'LID'), 'filter' => array('LID' => $restriction['PARAMS']['SITE_ID'], 'LANGUAGE_ID' => $context->getLanguage())));
        while ($site = $siteRes->fetch()) {
            $pSite .= "<div>" . $site['NAME'] . " (" . $site['LID'] . ")</div>";
        }
    }
    $row->AddField("LID", $pSite);
    $description = \Bitrix\Sale\PaySystem\Manager::getHandlerDescription($f_ACTION_FILE);
    $row->AddField("ACTION_FILES", $description['NAME']);
    $arActions = array(array("ICON" => "edit", "TEXT" => GetMessage("SALE_EDIT"), "TITLE" => GetMessage("SALE_EDIT_DESCR"), "ACTION" => $lAdmin->ActionRedirect("sale_pay_system_edit.php?ID=" . $f_ID . "&lang=" . $context->getLanguage()), "DEFAULT" => true));
    if ($saleModulePermissions >= "W") {
        $arActions[] = array("SEPARATOR" => true);
        $arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("SALE_DELETE"), "TITLE" => GetMessage("SALE_DELETE_DESCR"), "ACTION" => "if(confirm('" . GetMessage('SALE_CONFIRM_DEL_MESSAGE') . "')) " . $lAdmin->ActionDoGroup($f_ID, "delete"));
    }
    $row->AddActions($arActions);
}
$lAdmin->AddFooter(array(array("title" => GetMessage("MAIN_ADMIN_LIST_SELECTED"), "value" => $dbRes->SelectedRowsCount()), array("counter" => true, "title" => GetMessage("MAIN_ADMIN_LIST_CHECKED"), "value" => "0")));
if ($saleModulePermissions == "W") {
    $lAdmin->AddGroupActionTable(array("delete" => GetMessage("MAIN_ADMIN_LIST_DELETE"), "activate" => GetMessage("MAIN_ADMIN_LIST_ACTIVATE"), "deactivate" => GetMessage("MAIN_ADMIN_LIST_DEACTIVATE")));
    $aContext = array(array("TEXT" => GetMessage("SPSAN_ADD_NEW"), "TITLE" => GetMessage("SPSAN_ADD_NEW_ALT"), "LINK" => "sale_pay_system_edit.php?lang=" . LANG, "ICON" => "btn_new"));
    $lAdmin->AddAdminContextMenu($aContext);
}
$lAdmin->CheckListMode();
Пример #11
-1
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
use Bitrix\Sale\Order;
$request = \Bitrix\Main\Application::getInstance()->getContext()->getRequest();
$entityId = IntVal($request->get("InvId"));
list($orderId, $paymentId) = \Bitrix\Sale\PaySystem\Manager::getIdsByPayment($entityId);
if ($orderId > 0) {
    /** @var \Bitrix\Sale\Order $order */
    $order = \Bitrix\Sale\Order::load($orderId);
    if ($order) {
        /** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
        $paymentCollection = $order->getPaymentCollection();
        if ($paymentCollection && $paymentId > 0) {
            /** @var \Bitrix\Sale\Payment $payment */
            $payment = $paymentCollection->getItemById($paymentId);
            if ($payment) {
                $data = \Bitrix\Sale\PaySystem\Manager::getById($payment->getPaymentSystemId());
                $service = new \Bitrix\Sale\PaySystem\Service($data);
                if ($service) {
                    $service->processRequest($request);
                }
            }
        }
    }
}