当前位置: 首页>>代码示例>>PHP>>正文


PHP CCurrencyRates类代码示例

本文整理汇总了PHP中CCurrencyRates的典型用法代码示例。如果您正苦于以下问题:PHP CCurrencyRates类的具体用法?PHP CCurrencyRates怎么用?PHP CCurrencyRates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CCurrencyRates类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: calculateConcrete

 protected function calculateConcrete(\Bitrix\Sale\Shipment $shipment = null)
 {
     $result = new CalculationResult();
     $price = $this->config["MAIN"]["PRICE"];
     if ($shipment && \Bitrix\Main\Loader::includeModule('currency')) {
         $rates = new \CCurrencyRates();
         $currency = $this->currency;
         $shipmentCurrency = $shipment->getCollection()->getOrder()->getCurrency();
         $price = $rates->convertCurrency($price, $currency, $shipmentCurrency);
     }
     $result->setDeliveryPrice(roundEx($price, SALE_VALUE_PRECISION));
     $result->setPeriodDescription($this->getPeriodText());
     return $result;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:14,代码来源:configurable.php

示例2: PrepareCurrency4Where

	public static function PrepareCurrency4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
	{
		$val = DoubleVal($val);

		$baseSiteCurrency = "";
		if (isset($arFilter["LID"]) && strlen($arFilter["LID"]) > 0)
			$baseSiteCurrency = CSaleLang::GetLangCurrency($arFilter["LID"]);
		elseif (isset($arFilter["CURRENCY"]) && strlen($arFilter["CURRENCY"]) > 0)
			$baseSiteCurrency = $arFilter["CURRENCY"];

		if (strlen($baseSiteCurrency) <= 0)
			return False;

		$strSqlSearch = "";

		$dbCurrency = CCurrency::GetList(($by = "sort"), ($order = "asc"));
		while ($arCurrency = $dbCurrency->Fetch())
		{
			$val1 = roundEx(CCurrencyRates::ConvertCurrency($val, $baseSiteCurrency, $arCurrency["CURRENCY"]), SALE_VALUE_PRECISION);
			if (strlen($strSqlSearch) > 0)
				$strSqlSearch .= " OR ";

			$strSqlSearch .= "(D.ORDER_CURRENCY = '".$arCurrency["CURRENCY"]."' AND ";
			if ($negative == "Y")
				$strSqlSearch .= "NOT";
			$strSqlSearch .= "(".$field." ".$operation." ".$val1." OR ".$field." IS NULL OR ".$field." = 0)";
			$strSqlSearch .= ")";
		}

		return "(".$strSqlSearch.")";
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:31,代码来源:delivery.php

示例3: DoProcessOrderDelivery

 static function DoProcessOrderDelivery(&$arOrder, $arOptions, &$arErrors)
 {
     if ((!array_key_exists("TAX_LOCATION", $arOrder) || intval($arOrder["TAX_LOCATION"]) <= 0) && !$arOrder["USE_VAT"]) {
         return;
     }
     if (!array_key_exists("COUNT_DELIVERY_TAX", $arOptions)) {
         $arOptions["COUNT_DELIVERY_TAX"] = COption::GetOptionString("sale", "COUNT_DELIVERY_TAX", "N");
     }
     if (doubleval($arOrder["DELIVERY_PRICE"]) <= 0 || $arOptions["COUNT_DELIVERY_TAX"] != "Y") {
         return;
     }
     if (!$arOrder["USE_VAT"]) {
         if (!array_key_exists("TAX_EXEMPT", $arOrder)) {
             $arUserGroups = CUser::GetUserGroup($arOrder["USER_ID"]);
             $dbTaxExemptList = CSaleTax::GetExemptList(array("GROUP_ID" => $arUserGroups));
             while ($TaxExemptList = $dbTaxExemptList->Fetch()) {
                 if (!in_array(intval($TaxExemptList["TAX_ID"]), $arOrder["TAX_EXEMPT"])) {
                     $arOrder["TAX_EXEMPT"][] = intval($TaxExemptList["TAX_ID"]);
                 }
             }
         }
         if (!array_key_exists("TAX_LIST", $arOrder)) {
             $arOrder["TAX_LIST"] = array();
             $dbTaxRate = CSaleTaxRate::GetList(array("APPLY_ORDER" => "ASC"), array("LID" => $arOrder["SITE_ID"], "PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"], "ACTIVE" => "Y", "LOCATION" => $arOrder["TAX_LOCATION"]));
             while ($arTaxRate = $dbTaxRate->GetNext()) {
                 if (!in_array(intval($arTaxRate["TAX_ID"]), $arOrder["TAX_EXEMPT"])) {
                     if ($arTaxRate["IS_PERCENT"] != "Y") {
                         $arTaxRate["VALUE"] = RoundEx(CCurrencyRates::ConvertCurrency($arTaxRate["VALUE"], $arTaxRate["CURRENCY"], $arOrder["CURRENCY"]), SALE_VALUE_PRECISION);
                         $arTaxRate["CURRENCY"] = $arOrder["CURRENCY"];
                     }
                     $arOrder["TAX_LIST"][] = $arTaxRate;
                 }
             }
         }
         if (count($arOrder["TAX_LIST"]) > 0) {
             CSaleOrderTax::CountTaxes($arOrder["DELIVERY_PRICE"], $arOrder["TAX_LIST"], $arOrder["CURRENCY"]);
             foreach ($arOrder["TAX_LIST"] as &$arTax) {
                 $arTax["VALUE_MONEY"] += roundEx($arTax["TAX_VAL"], SALE_VALUE_PRECISION);
             }
             unset($arTax);
             $arOrder["TAX_PRICE"] = 0;
             foreach ($arOrder["TAX_LIST"] as $arTax) {
                 if ($arTax["IS_IN_PRICE"] != "Y") {
                     $arOrder["TAX_PRICE"] += roundEx($arTax["VALUE_MONEY"], SALE_VALUE_PRECISION);
                 }
             }
         }
     } else {
         $deliveryVat = roundEx($arOrder["DELIVERY_PRICE"] * $arOrder["VAT_RATE"] / (1 + $arOrder["VAT_RATE"]), 2);
         $arOrder["VAT_SUM"] += $deliveryVat;
         $arOrder["VAT_DELIVERY"] += $deliveryVat;
         //if (!array_key_exists("TAX_LIST", $arOrder))
         //{
         $arOrder["TAX_LIST"][0] = array("NAME" => GetMessage("SOA_VAT"), "IS_PERCENT" => "Y", "VALUE" => $arOrder["VAT_RATE"] * 100, "VALUE_FORMATED" => "(" . $arOrder["VAT_RATE"] * 100 . "%, " . GetMessage("SOA_VAT_INCLUDED") . ")", "VALUE_MONEY" => $arOrder["VAT_SUM"], "VALUE_MONEY_FORMATED" => SaleFormatCurrency($arOrder["VAT_SUM"], $arOrder["CURRENCY"]), "APPLY_ORDER" => 100, "IS_IN_PRICE" => "Y", "CODE" => "VAT");
         //}
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:57,代码来源:tax.php

示例4: OnSalePayOrderHandler

 /**
  *	Обработчик события подтверждения оплаты товара
  */
 function OnSalePayOrderHandler($id, $val)
 {
     $currentUserId = $GLOBALS['USER']->GetID();
     //Идентификатор текущего пользователя, по идее администратор
     $idRatingGroup = 5;
     //группа акции
     $curTo = "UAH";
     //тип гривневой цены
     $arOrder = CSaleOrder::GetByID($id);
     //информация о заказе
     $price = CCurrencyRates::ConvertCurrency(floatval($arOrder["SUM_PAID"]), $arOrder["CURRENCY"], $curTo);
     $price = intval(ceil($price));
     //стоимость заказа
     $userId = intval($arOrder["USER_ID"]);
     //пользователь, который оплатил заказ
     $arUserData = CUser::GetByID($userId)->Fetch();
     //Информация о пользователе
     $userGroups = CUser::GetUserGroup($userId);
     //ИД групп, к которым принадлежит пользователь
     //Если пользователя нет в акционной группе, и он совершил заказ более чем на 900 грн, то добавить его в группу
     if (!in_array($idRatingGroup, $userGroups)) {
         if ($price >= 900 && $price <= 4000 && $val === 'Y') {
             $userGroups[] = $idRatingGroup;
             CUser::SetUserGroup($userId, $userGroups);
         }
     }
     $points = $price * 5;
     $payedUser = new CUser();
     //Если оплата подтверждается, то добавить баллы
     if ($val === 'Y' && in_array($idRatingGroup, $userGroups)) {
         $points = intval($arUserData['UF_ACTION_POINTS']) + $points;
         $payedUser->Update($userId, array("UF_ACTION_POINTS" => $points, "UF_DATE_LAST_BUY" => $arOrder["DATE_UPDATE_FORMAT"]));
     } else {
         if ($val === 'N') {
             $price = CCurrencyRates::ConvertCurrency(floatval($arOrder["PRICE"]), $arOrder["CURRENCY"], $curTo);
             $price = intval(ceil($price));
             //вычитаем полную стоимость
             $points = $price * 5;
             if ($arUserData['UF_ACTION_POINTS'] >= $points) {
                 $points = intval($arUserData['UF_ACTION_POINTS']) - $points;
                 $payedUser->Update($userId, array("UF_ACTION_POINTS" => $points));
                 //Если очков стало меньше 4500, то исключаем пользователя из группы участников
                 if (in_array($idRatingGroup, $userGroups) && $points < 4500) {
                     $indexGroup = array_search($idRatingGroup, $userGroups);
                     if (isset($userGroups[$indexGroup])) {
                         unset($userGroups[$indexGroup]);
                         CUser::SetUserGroup($userId, $userGroups);
                     }
                 }
             }
         }
     }
     unset($payedUser);
 }
开发者ID:lenchv,项目名称:estore_additionl_work,代码行数:57,代码来源:rarus_event.php

示例5: convertToBaseCurrency

 public static function convertToBaseCurrency($value, $currency)
 {
     static $module, $baseCurrency;
     if (!$module) {
         $module = Loader::includeModule('currency');
         $baseCurrency = Config::getBaseCurrency();
     }
     if ($module && $currency != $baseCurrency) {
         $value = \CCurrencyRates::ConvertCurrency($value, $currency, $baseCurrency);
     }
     return $value;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:12,代码来源:utils.php

示例6: checkByShipment

 public function checkByShipment(\Bitrix\Sale\Shipment $shipment, array $restrictionParams, $deliveryId = 0)
 {
     if (empty($restrictionParams)) {
         return true;
     }
     $result = true;
     if (!($itemCollection = $shipment->getShipmentItemCollection())) {
         throw new SystemException("Cant get ShipmentItemCollection");
     }
     $shipmentPrice = $itemCollection->getPrice();
     if (\Bitrix\Main\Loader::includeModule('currency')) {
         $shipmentPrice = \CCurrencyRates::convertCurrency($shipmentPrice, $shipment->getCurrency(), $restrictionParams["CURRENCY"]);
     }
     if ($shipmentPrice >= 0) {
         $result = $this->check($shipmentPrice, $restrictionParams, $deliveryId);
     }
     return $result;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:18,代码来源:byprice.php

示例7: DoProcessOrder

	static function DoProcessOrder(&$arOrder, $deliveryId, &$arErrors)
	{
		if (!array_key_exists("DELIVERY_LOCATION", $arOrder) || intval($arOrder["DELIVERY_LOCATION"]) <= 0)
			return;

		if (strlen($deliveryId) > 0 && strpos($deliveryId, ":") !== false)
		{
			$arOrder["DELIVERY_ID"] = $deliveryId;

			$delivery = explode(":", $deliveryId);

			$arOrderTmpDel = array(
				"PRICE" => $arOrder["ORDER_PRICE"] + $arOrder["TAX_PRICE"] - $arOrder["DISCOUNT_PRICE"],
				"WEIGHT" => $arOrder["ORDER_WEIGHT"],
				"LOCATION_FROM" => COption::GetOptionString('sale', 'location', '2961', $arOrder["SITE_ID"]),
				"LOCATION_TO" => $arOrder["DELIVERY_LOCATION"],
				"LOCATION_ZIP" => $arOrder["DELIVERY_LOCATION_ZIP"],
				"ITEMS" => $arOrder["BASKET_ITEMS"]
			);

			$arDeliveryPrice = CSaleDeliveryHandler::CalculateFull($delivery[0], $delivery[1], $arOrderTmpDel, $arOrder["CURRENCY"],$arOrder["LID"]);

			if ($arDeliveryPrice["RESULT"] == "ERROR")
				$arErrors[] = array("CODE" => "CALCULATE", "TEXT" => $arDeliveryPrice["TEXT"]);
			else
				$arOrder["DELIVERY_PRICE"] = roundEx($arDeliveryPrice["VALUE"], SALE_VALUE_PRECISION);
		}
		elseif (intval($deliveryId) > 0)
		{
			if ($arDelivery = CSaleDelivery::GetByID($deliveryId))
			{
				$arOrder["DELIVERY_ID"] = $deliveryId;
				$arOrder["DELIVERY_PRICE"] = roundEx(CCurrencyRates::ConvertCurrency($arDelivery["PRICE"], $arDelivery["CURRENCY"], $arOrder["CURRENCY"]), SALE_VALUE_PRECISION);
			}
			else
			{
				$arErrors[] = array("CODE" => "CALCULATE", "TEXT" => GetMessage('SKGD_DELIVERY_NOT_FOUND'));
			}
		}
	}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:40,代码来源:delivery.php

示例8: loadAvailableList

 /**
  * @return array
  */
 protected function loadAvailableList()
 {
     $order = $this->getOrder();
     $basket = $order->getBasket();
     if (!$basket) {
         return null;
     }
     if (!$order->isUsedVat()) {
         $taxExemptList = static::loadExemptList($order->getUserId());
         $taxRateRes = \CSaleTaxRate::GetList(array("APPLY_ORDER" => "ASC"), array("LID" => $order->getSiteId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "ACTIVE" => "Y", "LOCATION" => $order->getTaxLocation()));
         while ($taxRate = $taxRateRes->GetNext()) {
             if (!in_array(intval($taxRate["TAX_ID"]), $taxExemptList)) {
                 if ($taxRate["IS_PERCENT"] != "Y") {
                     $taxRate["VALUE"] = RoundEx(\CCurrencyRates::convertCurrency($taxRate["VALUE"], $taxRate["CURRENCY"], $order->getCurrency()), SALE_VALUE_PRECISION);
                     $taxRate["CURRENCY"] = $order->getCurrency();
                 }
                 $this->availableList[] = $taxRate;
             }
         }
     } else {
         $this->availableList[] = array("NAME" => Loc::getMessage("SOA_VAT"), "IS_PERCENT" => "Y", "VALUE" => $order->getVatRate() * 100, "VALUE_FORMATED" => "(" . $order->getVatRate() * 100 . "%, " . GetMessage("SOA_VAT_INCLUDED") . ")", "VALUE_MONEY" => $order->getVatSum(), "VALUE_MONEY_FORMATED" => SaleFormatCurrency($order->getVatSum(), $order->getCurrency()), "APPLY_ORDER" => 100, "IS_IN_PRICE" => "Y", "CODE" => "VAT");
     }
     return $this->availableList;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:27,代码来源:tax.php

示例9: __PrimaryDiscountFilter

	protected function __PrimaryDiscountFilter(&$arDiscount, &$arPriceDiscount, &$arDiscSave, &$arParams)
	{
		if (isset($arParams['PRICE']) && isset($arParams['CURRENCY']))
		{
			$arParams['PRICE'] = doubleval($arParams['PRICE']);
			if (0 < $arParams['PRICE'])
			{
				$arPriceDiscount = array();
				$arDiscSave = array();

				foreach ($arDiscount as $arOneDiscount)
				{
					$dblDiscountValue = 0.0;
					if ('F' == $arOneDiscount['VALUE_TYPE'])
					{
						if ($arParams['CURRENCY'] == $arOneDiscount["CURRENCY"])
							$dblDiscountValue = $arOneDiscount["VALUE"];
						else
							$dblDiscountValue = CCurrencyRates::ConvertCurrency($arOneDiscount["VALUE"], $arOneDiscount["CURRENCY"], $arParams['CURRENCY']);
						if ($arParams['PRICE'] < $dblDiscountValue)
							continue;
						$arOneDiscount['DISCOUNT_CONVERT'] = $dblDiscountValue;
					}
					elseif ('S' == $arOneDiscount['VALUE_TYPE'])
					{
						if ($arParams['CURRENCY'] == $arOneDiscount["CURRENCY"])
							$dblDiscountValue = $arOneDiscount["VALUE"];
						else
							$dblDiscountValue = CCurrencyRates::ConvertCurrency($arOneDiscount["VALUE"], $arOneDiscount["CURRENCY"], $arParams['CURRENCY']);
						if ($arParams['PRICE'] <= $dblDiscountValue)
							continue;
						$arOneDiscount['DISCOUNT_CONVERT'] = $dblDiscountValue;
					}
					elseif ('P' == $arOneDiscount['VALUE_TYPE'])
					{
						if (100 < $arOneDiscount["VALUE"])
							continue;
						if (DISCOUNT_TYPE_STANDART == $arOneDiscount['TYPE'] && 0 < $arOneDiscount["MAX_DISCOUNT"])
						{
							if ($arParams['CURRENCY'] == $arOneDiscount["CURRENCY"])
								$dblDiscountValue = $arOneDiscount["MAX_DISCOUNT"];
							else
								$dblDiscountValue = CCurrencyRates::ConvertCurrency($arOneDiscount["MAX_DISCOUNT"], $arOneDiscount["CURRENCY"], $arParams['CURRENCY']);
							$arOneDiscount['DISCOUNT_CONVERT'] = $dblDiscountValue;
						}
					}
					if (DISCOUNT_TYPE_SAVE == $arOneDiscount['TYPE'])
					{
						$arDiscSave[] = $arOneDiscount;
					}
					else
					{
						$arPriceDiscount[intval($arOneDiscount['PRIORITY'])][] = $arOneDiscount;
					}
				}

				if (!empty($arPriceDiscount))
					krsort($arPriceDiscount);
			}
		}
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:61,代码来源:product.php

示例10: fGetDeliverySystemsHTML

		}
		else
			$arDelivery = fGetDeliverySystemsHTML($location, $locationZip, $arOrder["ORDER_WEIGHT"], $arOrder["ORDER_PRICE"], $currency, $LID, $deliveryId, $arShoppingCart);

		$arData[0]["ORDER_ID"] = $id;
		$arData[0]["DELIVERY"] = $arDelivery["DELIVERY"];

		if (isset($arOrder["PRICE_DELIVERY"]) && floatval($arOrder["PRICE_DELIVERY"]) >= 0 && floatval($arOrder["PRICE_DELIVERY"])."!" == $arOrder["PRICE_DELIVERY"]."!") //if number
		{
			$arData[0]["DELIVERY_PRICE"] = $arOrder["PRICE_DELIVERY"];
			$arData[0]["DELIVERY_PRICE_FORMAT"] = SaleFormatCurrency($arOrder["PRICE_DELIVERY"], $currency);
		}
		else
		{
			if ($arDelivery["CURRENCY"] != $currency)
				$arDelivery["DELIVERY_DEFAULT_PRICE"] = roundEx(CCurrencyRates::ConvertCurrency($arDelivery["DELIVERY_DEFAULT_PRICE"], $arDelivery["CURRENCY"], $currency), SALE_VALUE_PRECISION);

			$arDelivery["DELIVERY_DEFAULT_PRICE"] = floatval($arDelivery["DELIVERY_DEFAULT_PRICE"]);
			$arData[0]["DELIVERY_PRICE"] = $arDelivery["DELIVERY_DEFAULT_PRICE"];
			$arData[0]["DELIVERY_PRICE_FORMAT"] = SaleFormatCurrency($arDelivery["DELIVERY_DEFAULT_PRICE"], $currency);
		}
		$arData[0]["DELIVERY_DEFAULT"] = $arDelivery["DELIVERY_DEFAULT"];

		if (isset($arOrder["PRICE_DELIVERY_DIFF"]))
			$arData[0]["PRICE_DELIVERY_DIFF"] = SaleFormatCurrency(roundEx($arOrder["PRICE_DELIVERY_DIFF"], SALE_VALUE_PRECISION), $currency);

		if (strlen($arDelivery["DELIVERY_DEFAULT_ERR"]) > 0)
		{
			$arData[0]["DELIVERY_DESCRIPTION"] = $arDelivery["DELIVERY_DEFAULT_ERR"];
			$arData[0]["ORDER_ERROR"] = "Y";
		}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:order_new.php

示例11: PayUserAccountDeliveryOrderCallback

function PayUserAccountDeliveryOrderCallback($productID, $userID, $bPaid, $orderID, $quantity = 1)
{
    global $DB;
    $productID = IntVal($productID);
    $userID = IntVal($userID);
    $bPaid = $bPaid ? True : False;
    $orderID = IntVal($orderID);
    if ($userID <= 0) {
        return False;
    }
    if ($orderID <= 0) {
        return False;
    }
    if (!($arOrder = CSaleOrder::GetByID($orderID))) {
        return False;
    }
    $baseLangCurrency = CSaleLang::GetLangCurrency($arOrder["LID"]);
    $arAmount = unserialize(COption::GetOptionString("sale", "pay_amount", 'a:4:{i:1;a:2:{s:6:"AMOUNT";s:2:"10";s:8:"CURRENCY";s:3:"EUR";}i:2;a:2:{s:6:"AMOUNT";s:2:"20";s:8:"CURRENCY";s:3:"EUR";}i:3;a:2:{s:6:"AMOUNT";s:2:"30";s:8:"CURRENCY";s:3:"EUR";}i:4;a:2:{s:6:"AMOUNT";s:2:"40";s:8:"CURRENCY";s:3:"EUR";}}'));
    if (!array_key_exists($productID, $arAmount)) {
        return False;
    }
    $currentPrice = $arAmount[$productID]["AMOUNT"] * $quantity;
    $currentCurrency = $arAmount[$productID]["CURRENCY"];
    if ($arAmount[$productID]["CURRENCY"] != $baseLangCurrency) {
        $currentPrice = CCurrencyRates::ConvertCurrency($arAmount[$productID]["AMOUNT"], $arAmount[$productID]["CURRENCY"], $baseLangCurrency) * $quantity;
        $currentCurrency = $baseLangCurrency;
    }
    if (!CSaleUserAccount::UpdateAccount($userID, $bPaid ? $currentPrice : -$currentPrice, $currentCurrency, "MANUAL", $orderID, "Payment to user account")) {
        return False;
    }
    return True;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:32,代码来源:include.php

示例12: foreach

 $found = false;
 $resort = false;
 foreach ($currentSet['ITEMS'] as &$setItem) {
     if (!isset($setItem['ITEM_DATA'])) {
         continue;
     }
     $setItem['ITEM_DATA']['SET_QUANTITY'] = empty($setItem['QUANTITY']) ? 1 : $setItem['QUANTITY'];
     $setItem['ITEM_DATA']['MEASURE_RATIO'] = $arResult['ITEMS_RATIO'][$setItem['ITEM_DATA']['ID']];
     $setItem['ITEM_DATA']['MEASURE'] = !empty($ratioResult[$setItem['ITEM_DATA']['ID']]['MEASURE']) ? $ratioResult[$setItem['ITEM_DATA']['ID']]['MEASURE'] : $defaultMeasure;
     $setItem['ITEM_DATA']['BASKET_QUANTITY'] = $setItem['ITEM_DATA']['SET_QUANTITY'] * $setItem['ITEM_DATA']['MEASURE_RATIO'];
     $arResult['BASKET_QUANTITY'][$setItem['ITEM_DATA']['ID']] = $setItem['ITEM_DATA']['BASKET_QUANTITY'];
     $setItem['ITEM_DATA']['SET_SORT'] = $setItem['SORT'];
     if ($arParams['CONVERT_CURRENCY'] == 'N' && $setItem['ITEM_DATA']['PRICE_CURRENCY'] != $defaultCurrency) {
         $setItem['ITEM_DATA']['PRICE_CONVERT_DISCOUNT_VALUE'] = CCurrencyRates::ConvertCurrency($setItem['ITEM_DATA']['PRICE_DISCOUNT_VALUE'], $setItem['ITEM_DATA']['PRICE_CURRENCY'], $defaultCurrency);
         $setItem['ITEM_DATA']['PRICE_CONVERT_VALUE'] = CCurrencyRates::ConvertCurrency($setItem['ITEM_DATA']["PRICE_VALUE"], $setItem['ITEM_DATA']['PRICE_CURRENCY'], $defaultCurrency);
         $setItem['ITEM_DATA']['PRICE_CONVERT_DISCOUNT_DIFFERENCE_VALUE'] = CCurrencyRates::ConvertCurrency($setItem['ITEM_DATA']['PRICE_DISCOUNT_DIFFERENCE_VALUE'], $setItem['ITEM_DATA']['PRICE_CURRENCY'], $defaultCurrency);
         $setItem['ITEM_DATA']['PRICE_CURRENCY'] = $defaultCurrency;
     }
     if ($setItem['ITEM_DATA']['CAN_BUY'] && $countSetDefaultItems < 3) {
         $arResult['SET_ITEMS']['DEFAULT'][] = $setItem['ITEM_DATA'];
         $arResult['SET_ITEMS']['PRICE'] += $setItem['ITEM_DATA']['PRICE_DISCOUNT_VALUE'] * $setItem['ITEM_DATA']['BASKET_QUANTITY'];
         $arResult['SET_ITEMS']['OLD_PRICE'] += $setItem['ITEM_DATA']['PRICE_VALUE'] * $setItem['ITEM_DATA']['BASKET_QUANTITY'];
         $arResult['SET_ITEMS']['PRICE_DISCOUNT_DIFFERENCE'] += $setItem['ITEM_DATA']['PRICE_DISCOUNT_DIFFERENCE_VALUE'] * $setItem['ITEM_DATA']['BASKET_QUANTITY'];
         $countSetDefaultItems++;
     } else {
         if (!$setItem['ITEM_DATA']['CAN_BUY']) {
             $resort = true;
         }
         $arResult['SET_ITEMS']['OTHER'][] = $setItem['ITEM_DATA'];
     }
     $found = true;
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例13: calculateInReportCurrency

 public static function calculateInReportCurrency($value)
 {
     $res = $value;
     if (self::$reportCurrencyId != self::$siteCurrencyId) {
         $res = \CCurrencyRates::ConvertCurrency($value, self::$siteCurrencyId, self::$reportCurrencyId);
     }
     return $res;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:sale_report_helper.php

示例14: foreach

            $arID[] = $arRes['ID'];
        }
    }
    foreach ($arID as $ID) {
        $ID = (int) $ID;
        if ($ID <= 0) {
            continue;
        }
        switch ($_REQUEST['action']) {
            case "delete":
                CCurrencyRates::Delete($ID);
                break;
        }
    }
}
$rsData = CCurrencyRates::GetList($by, $order, $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("curr_rates_nav")));
$arHeaders = array();
$arHeaders[] = array("id" => "ID", "content" => "ID", "default" => false);
$arHeaders[] = array("id" => "CURRENCY", "content" => GetMessage('curr_rates_curr1'), "sort" => "curr", "default" => true);
$arHeaders[] = array("id" => "DATE_RATE", "content" => GetMessage('curr_rates_date1'), "sort" => "date", "default" => true);
$arHeaders[] = array("id" => "RATE_CNT", "content" => GetMessage('curr_rates_rate_cnt'), "default" => true);
$arHeaders[] = array("id" => "RATE", "content" => GetMessage('curr_rates_rate'), "sort" => "rate", "default" => true);
$lAdmin->AddHeaders($arHeaders);
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arRes, "/bitrix/admin/currency_rate_edit.php?ID=" . $f_ID . "&lang=" . LANGUAGE_ID . GetFilterParams("filter_"), GetMessage('CURRENCY_RATES_A_EDIT'));
    $row->AddViewField('ID', '<a href="/bitrix/admin/currency_rate_edit.php?ID=' . $f_ID . '&lang=' . LANGUAGE_ID . GetFilterParams("filter_") . '" title="' . GetMessage('CURRENCY_RATES_A_EDIT_TITLE') . '">' . $f_ID . '</a>');
    $row->AddViewField('CURRENCY', '<a href="/bitrix/admin/currency_edit.php?ID=' . $f_CURRENCY . '&lang=' . LANGUAGE_ID . '" title="' . GetMessage('CURRENCY_A_EDIT_TITLE') . '">' . $f_CURRENCY . '</a>');
    $row->AddCalendarField('DATE_RATE');
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:currencies_rates.php

示例15:

 $bCorrectPayment = True;
 $err = 0;
 $err_text = '';
 if ($arOrder = CSaleOrder::GetByID(IntVal($lmi_payment_no))) {
     $bCorrectPayment = False;
     $err = 1;
     $err_text = 'ERR: НЕТ ТАКОГО ЗАКАЗА';
 }
 if ($bCorrectPayment) {
     CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
 }
 $IdM = CSalePaySystemAction::GetParamValue("ZP_SHOP_ID");
 $sk = CSalePaySystemAction::GetParamValue("ZP_MERCHANT_KEY");
 $CruR = CSalePaySystemAction::GetParamValue("ZP_CODE_RUR");
 // Проверяем, не произошла ли подмена суммы.
 $order_amount = CCurrencyRates::ConvertCurrency($arOrder["PRICE"], $arOrder["CURRENCY"], $CruR);
 if ($order_amount != $lmi_payment_amount) {
     $err = 2;
     $err_text = 'ERR: НЕВЕРНАЯ СУММА : ' . $lmi_payment_amount;
 }
 //проверяем ID магазина
 if ($lmi_payee_purse != $IdM) {
     $err = 3;
     $err_text = 'ERR: НЕВЕРЕН ID МАГАЗИНА : ' . $lmi_payee_purse;
 }
 if ($lmi_prerequest == 1) {
     if ($err != 0) {
         echo $err_text;
     } else {
         echo 'YES';
     }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:z_payment_result.php


注:本文中的CCurrencyRates类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。