本文整理汇总了PHP中CCurrencyRates类的典型用法代码示例。如果您正苦于以下问题:PHP CCurrencyRates类的具体用法?PHP CCurrencyRates怎么用?PHP CCurrencyRates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCurrencyRates类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: foreach
$arItem['JS_OFFERS'] = $arMatrix;
$arItem['OFFERS_SELECTED'] = $intSelected;
$arItem['OFFERS_PROPS_DISPLAY'] = $boolSKUDisplayProperties;
} else {
$arMinPrice = false;
$dblMinPrice = 0;
$strMinCurrency = $boolConvert ? $arResult['CONVERT_CURRENCY']['CURRENCY_ID'] : $strBaseCurrency;
foreach ($arItem['OFFERS'] as $keyOffer => $arOffer) {
if (!$arOffer['CAN_BUY']) {
continue;
}
if (empty($arMinPrice)) {
$dblMinPrice = $boolConvert || $arOffer['MIN_PRICE']['CURRENCY'] == $strMinCurrency ? $arOffer['MIN_PRICE']['DISCOUNT_VALUE'] : CCurrencyRates::ConvertCurrency($arOffer['MIN_PRICE']['DISCOUNT_VALUE'], $arOffer['MIN_PRICE']['CURRENCY'], $strMinCurrency);
$arMinPrice = $arOffer['MIN_PRICE'];
} else {
$dblComparePrice = $boolConvert || $arOffer['MIN_PRICE']['CURRENCY'] == $strMinCurrency ? $arOffer['MIN_PRICE']['DISCOUNT_VALUE'] : CCurrencyRates::ConvertCurrency($arOffer['MIN_PRICE']['DISCOUNT_VALUE'], $arOffer['MIN_PRICE']['CURRENCY'], $strMinCurrency);
if ($dblMinPrice > $dblComparePrice) {
$dblMinPrice = $dblComparePrice;
$arMinPrice = $arOffer['MIN_PRICE'];
}
}
}
$arItem['MIN_PRICE'] = $arMinPrice;
}
}
if (empty($arItem['PREVIEW_PICTURE'])) {
$arItem['PREVIEW_PICTURE'] = $arItem['DETAIL_PICTURE'];
}
if ('' != $arParams['ADD_PICT_PROP'] && isset($arItem['PROPERTIES'][$arParams['ADD_PICT_PROP']])) {
if ('F' == $arItem['PROPERTIES'][$arParams['ADD_PICT_PROP']]['PROPERTY_TYPE']) {
$arPict = false;
开发者ID:Andreyjktl,项目名称:kidster,代码行数:31,代码来源:result_modifier.php
示例17: __SaleOrderSumm
protected function __SaleOrderSumm($arOrderFilter, $strCurrency)
{
$arOrderSumm = array('ORDER_FILTER' => $arOrderFilter, 'SUMM' => 0, 'CURRENCY' => '', 'LAST_ORDER_DATE' => '', 'TIMESTAMP' => 0, 'RANGE_SUMM' => 0, 'RANGE_SUMM_CURRENCY' => $strCurrency);
foreach (GetModuleEvents('catalog', 'OnSaleOrderSumm', true) as $arEvent) {
$mxOrderCount = ExecuteModuleEventEx($arEvent, array($arOrderFilter));
if (!empty($mxOrderCount) && is_array($mxOrderCount)) {
$mxOrderCount['PRICE'] = (double) $mxOrderCount['PRICE'];
$arOrderSumm['LAST_ORDER_DATE'] = $mxOrderCount['LAST_ORDER_DATE'];
$arOrderSumm['SUMM'] = $mxOrderCount['PRICE'];
$arOrderSumm['CURRENCY'] = $mxOrderCount['CURRENCY'];
$arOrderSumm['TIMESTAMP'] = $mxOrderCount['TIMESTAMP'];
$arOrderSumm['RANGE_SUMM'] = $mxOrderCount['CURRENCY'] != $strCurrency ? CCurrencyRates::ConvertCurrency($mxOrderCount['PRICE'], $mxOrderCount['CURRENCY'], $strCurrency) : $mxOrderCount['PRICE'];
break;
}
}
foreach (GetModuleEvents('catalog', 'OnSaleOrderSummResult', true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array(&$arOrderSumm));
}
return $arOrderSumm;
}
开发者ID:Satariall,项目名称:izurit,代码行数:20,代码来源:discount_save.php
示例18: foreach
if ($arStoreTmp["IMAGE_ID"] > 0) {
$arStoreTmp["IMAGE_ID"] = CFile::GetFileArray($arStoreTmp["IMAGE_ID"]);
}
$arStore[$arStoreTmp["ID"]] = $arStoreTmp;
}
$arResult["STORE_LIST"] = $arStore;
if (!$bFound && !empty($arUserResult["DELIVERY_ID"]) && strpos($arUserResult["DELIVERY_ID"], ":") === false) {
$arUserResult["DELIVERY_ID"] = "";
}
foreach ($arDeliveryAll as $arDelivery) {
if (count($arP2D[$arUserResult["PAY_SYSTEM_ID"]]) <= 0 || in_array($arDelivery["ID"], $arP2D[$arUserResult["PAY_SYSTEM_ID"]])) {
$arDelivery["FIELD_NAME"] = "DELIVERY_ID";
if (IntVal($arUserResult["DELIVERY_ID"]) == IntVal($arDelivery["ID"])) {
$arDelivery["CHECKED"] = "Y";
$arUserResult["DELIVERY_ID"] = $arDelivery["ID"];
$arResult["DELIVERY_PRICE"] = roundEx(CCurrencyRates::ConvertCurrency($arDelivery["PRICE"], $arDelivery["CURRENCY"], $arResult["BASE_LANG_CURRENCY"]), SALE_VALUE_PRECISION);
$bSelected = true;
}
if (IntVal($arDelivery["PERIOD_FROM"]) > 0 || IntVal($arDelivery["PERIOD_TO"]) > 0) {
$arDelivery["PERIOD_TEXT"] = GetMessage("SALE_DELIV_PERIOD");
if (IntVal($arDelivery["PERIOD_FROM"]) > 0) {
$arDelivery["PERIOD_TEXT"] .= " " . GetMessage("SOA_FROM") . " " . IntVal($arDelivery["PERIOD_FROM"]);
}
if (IntVal($arDelivery["PERIOD_TO"]) > 0) {
$arDelivery["PERIOD_TEXT"] .= " " . GetMessage("SOA_TO") . " " . IntVal($arDelivery["PERIOD_TO"]);
}
if ($arDelivery["PERIOD_TYPE"] == "H") {
$arDelivery["PERIOD_TEXT"] .= " " . GetMessage("SOA_HOUR") . " ";
} elseif ($arDelivery["PERIOD_TYPE"] == "M") {
$arDelivery["PERIOD_TEXT"] .= " " . GetMessage("SOA_MONTH") . " ";
} else {
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:31,代码来源:component.php
示例19: GetIBlockSectionPath
$strCategory = $ar_iblock["NAME"];
$sections_path = GetIBlockSectionPath($IBLOCK_ID, $ar_elems["IBLOCK_SECTION_ID"]);
while ($arSection = $sections_path->GetNext()) {
if (strlen($strCategory) > 0) {
$strCategory .= ">";
}
$strCategory .= $arSection["NAME"];
}
$arSectionPaths[IntVal($ar_elems["IBLOCK_SECTION_ID"])] = PrepareString($strCategory);
}
$minPrice = 0;
for ($i = 0, $intPCount = count($arPTypes); $i < $intPCount; $i++) {
if (strlen($ar_elems["CATALOG_CURRENCY_" . $arPTypes[$i]]) <= 0) {
continue;
}
$tmpPrice = Round(CCurrencyRates::ConvertCurrency($ar_elems["CATALOG_PRICE_" . $arPTypes[$i]], $ar_elems["CATALOG_CURRENCY_" . $arPTypes[$i]], "USD"), 2);
if ($minPrice <= 0 || $minPrice > $tmpPrice) {
$minPrice = $tmpPrice;
}
}
if ($minPrice <= 0) {
continue;
}
@fwrite($fp, "http://" . COption::GetOptionString("main", "server_name", $SERVER_NAME) . str_replace("//", "/", $ar_elems["DETAIL_PAGE_URL"]) . "\t" . $ar_elems["~NAME"] . "\t" . PrepareString($ar_elems["~PREVIEW_TEXT"], true) . "\t" . $strImage . "\t" . $arSectionPaths[IntVal($ar_elems["IBLOCK_SECTION_ID"])] . "\t" . $minPrice . "\n");
}
@fclose($fp);
}
}
CCatalogDiscountSave::Enable();
if ($bTmpUserCreated) {
unset($USER);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:froogle_run.php
示例20: FormatCurrency
{
//convert all prices to main element currency
foreach($arResult["SET_ITEMS"]["DEFAULT"] as $key=>$arItem)
{
$arResult["SET_ITEMS"]["DEFAULT"][$key]["PRICE_CONVERT_DISCOUNT_VALUE"] = CCurrencyRates::ConvertCurrency($arItem['PRICE_DISCOUNT_VALUE'], $arItem["PRICE_CURRENCY"] , $arResult["ELEMENT"]["PRICE_CURRENCY"]);
$arResult["SET_ITEMS"]["PRICE"] += $arResult["SET_ITEMS"]["DEFAULT"][$key]["PRICE_CONVERT_DISCOUNT_VALUE"];
$arResult["SET_ITEMS"]["DEFAULT"][$key]["PRICE_CONVERT_VALUE"] = CCurrencyRates::ConvertCurrency($arItem["PRICE_VALUE"], $arItem["PRICE_CURRENCY"] , $arResult["ELEMENT"]["PRICE_CURRENCY"]);
$arResult["SET_ITEMS"]["OLD_PRICE"] += $arResult["SET_ITEMS"]["DEFAULT"][$key]["PRICE_CONVERT_VALUE"];
$arResult["SET_ITEMS"]["DEFAULT"][$key]["PRICE_CONVERT_DISCOUNT_DIFFERENCE_VALUE"] = CCurrencyRates::ConvertCurrency($arItem["PRICE_DISCOUNT_DIFFERENCE_VALUE"], $arItem["PRICE_CURRENCY"] , $arResult["ELEMENT"]["PRICE_CURRENCY"]);
$arResult["SET_ITEMS"]["PRICE_DISCOUNT_DIFFERENCE"] += $arResult["SET_ITEMS"]["DEFAULT"][$key]["PRICE_CONVERT_DISCOUNT_DIFFERENCE_VALUE"];
}
foreach($arResult["SET_ITEMS"]["OTHER"] as $key=>$arItem)
{
$arResult["SET_ITEMS"]["OTHER"][$key]["PRICE_CONVERT_DISCOUNT_VALUE"] = CCurrencyRates::ConvertCurrency($arItem['PRICE_DISCOUNT_VALUE'], $arItem["PRICE_CURRENCY"] , $arResult["ELEMENT"]["PRICE_CURRENCY"]);
$arResult["SET_ITEMS"]["OTHER"][$key]["PRICE_CONVERT_VALUE"] = CCurrencyRates::ConvertCurrency($arItem["PRICE_VALUE"], $arItem["PRICE_CURRENCY"] , $arResult["ELEMENT"]["PRICE_CURRENCY"]);
$arResult["SET_ITEMS"]["OTHER"][$key]["PRICE_CONVERT_DISCOUNT_DIFFERENCE_VALUE"] = CCurrencyRates::ConvertCurrency($arItem["PRICE_DISCOUNT_DIFFERENCE_VALUE"], $arItem["PRICE_CURRENCY"] , $arResult["ELEMENT"]["PRICE_CURRENCY"]);
}
}
if ($arResult[&qu
|
请发表评论