本文整理匯總了PHP中CCurrencyLang::GetCurrencyFormat方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCurrencyLang::GetCurrencyFormat方法的具體用法?PHP CCurrencyLang::GetCurrencyFormat怎麽用?PHP CCurrencyLang::GetCurrencyFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCurrencyLang
的用法示例。
在下文中一共展示了CCurrencyLang::GetCurrencyFormat方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CurrencyFormatNumber
function CurrencyFormatNumber($price, $currency)
{
$arCurFormat = CCurrencyLang::GetCurrencyFormat($currency);
if (!isset($arCurFormat["DECIMALS"])) {
$arCurFormat["DECIMALS"] = 2;
}
$arCurFormat["DECIMALS"] = IntVal($arCurFormat["DECIMALS"]);
if (!isset($arCurFormat["DEC_POINT"])) {
$arCurFormat["DEC_POINT"] = ".";
}
if (!empty($arCurFormat["THOUSANDS_VARIANT"])) {
if ($arCurFormat["THOUSANDS_VARIANT"] == "N") {
$arCurFormat["THOUSANDS_SEP"] = "";
} elseif ($arCurFormat["THOUSANDS_VARIANT"] == "D") {
$arCurFormat["THOUSANDS_SEP"] = ".";
} elseif ($arCurFormat["THOUSANDS_VARIANT"] == "C") {
$arCurFormat["THOUSANDS_SEP"] = ",";
} elseif ($arCurFormat["THOUSANDS_VARIANT"] == "S") {
$arCurFormat["THOUSANDS_SEP"] = chr(32);
} elseif ($arCurFormat["THOUSANDS_VARIANT"] == "B") {
$arCurFormat["THOUSANDS_SEP"] = chr(32);
}
}
if (!isset($arCurFormat["FORMAT_STRING"])) {
$arCurFormat["FORMAT_STRING"] = "#";
}
$price = number_format($price, $arCurFormat["DECIMALS"], $arCurFormat["DEC_POINT"], $arCurFormat["THOUSANDS_SEP"]);
if ($arCurFormat["THOUSANDS_VARIANT"] == "B") {
$num = str_replace(" ", " ", $num);
}
$price = str_replace(',', '.', $price);
return $price;
}
示例2: array
while($arItem = $dbItem->Fetch())
echo "<b>"."<a href=\"".CIBlock::GetAdminElementEditLink($arItem["IBLOCK_ID"], $arItem["ID"], array(
"find_section_section" => $arItem["IBLOCK_SECTION_ID"],
'WF' => 'Y',
))."\">".htmlspecialcharsbx($arItem["NAME"])."</a></b> (".GetMessage("NEWO_PRODUCTS_NA").")<br />";
}
echo EndNote();
}
?>
<script type="text/javascript">
var arProduct = [];
var arProductEditCountProps = [];
var countProduct = 0;
</script>
<?
$arCurFormat = CCurrencyLang::GetCurrencyFormat($str_CURRENCY);
$CURRENCY_FORMAT = trim(str_replace("#", '', $arCurFormat["FORMAT_STRING"]));
$ORDER_TOTAL_PRICE = 0;
$ORDER_PRICE_WITH_DISCOUNT = 0;
$productCountAll = 0;
$productWeight = 0;
$arFilterRecommended = array();
$WEIGHT_UNIT = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', "", $LID));
$WEIGHT_KOEF = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, $LID));
$QUANTITY_FACTORIAL = COption::GetOptionString('sale', 'QUANTITY_FACTORIAL', "N");
if (!isset($QUANTITY_FACTORIAL) OR $QUANTITY_FACTORIAL == "")
$QUANTITY_FACTORIAL = 'N';
//edit form props
$formTemplate = '
示例3: getProductDataToFillBasket
//.........這裏部分代碼省略.........
if (!($arProduct = $rsProducts->Fetch()))
{
return array();
}
$balance = floatval($arProduct["QUANTITY"]);
// sku props
$arSkuData = array();
$arProps[] = array(
"NAME" => "Catalog XML_ID",
"CODE" => "CATALOG.XML_ID",
"VALUE" => $arElementInfo['~IBLOCK_XML_ID']
);
$arSkuProperty = CSaleProduct::GetProductSkuProps($productId, '', true);
if (!empty($arSkuProperty))
{
foreach ($arSkuProperty as &$val)
{
$arSkuData[] = array(
'NAME' => $val['NAME'],
'VALUE' => $val['VALUE'],
'CODE' => $val['CODE']
);
}
unset($val);
}
$arSkuData[] = array(
"NAME" => "Product XML_ID",
"CODE" => "PRODUCT.XML_ID",
"VALUE" => $arElementInfo["~XML_ID"]
);
// currency
$arCurFormat = CCurrencyLang::GetCurrencyFormat($arElementInfo["CURRENCY"]);
$priceValutaFormat = str_replace("#", "", $arCurFormat["FORMAT_STRING"]);
$arElementInfo["WEIGHT"] = $arProduct["WEIGHT"];
// measure
$arElementInfo["MEASURE_TEXT"] = "";
if ((int)$arProduct["MEASURE"] > 0)
{
$dbMeasure = CCatalogMeasure::GetList(array(), array("ID" => intval($arProduct["MEASURE"])), false, false, array("ID", "SYMBOL_RUS", "SYMBOL_INTL"));
if ($arMeasure = $dbMeasure->Fetch())
$arElementInfo["MEASURE_TEXT"] = ($arMeasure["SYMBOL_RUS"] != '' ? $arMeasure["SYMBOL_RUS"] : $arMeasure["SYMBOL_INTL"]);
}
if ($arElementInfo["MEASURE_TEXT"] == '')
{
$arElementInfo["MEASURE_TEXT"] = ($defaultMeasure["SYMBOL_RUS"] != '' ? $defaultMeasure["SYMBOL_RUS"] : $defaultMeasure["SYMBOL_INTL"]);
}
// ratio
$arElementInfo["RATIO"] = 1;
$dbratio = CCatalogMeasureRatio::GetList(array(), array("PRODUCT_ID" => $productId));
if ($arRatio = $dbratio->Fetch())
$arElementInfo["RATIO"] = $arRatio["RATIO"];
// image
if ($arElementInfo["PREVIEW_PICTURE"] > 0)
$imgCode = $arElementInfo["PREVIEW_PICTURE"];
elseif ($arElementInfo["DETAIL_PICTURE"] > 0)
$imgCode = $arElementInfo["DETAIL_PICTURE"];
if ($imgCode == "" && count($arParent) > 0)
{
示例4: GetMessage
$tabControl->BeginCustomField("orders_list", GetMessage("SOD_ORDER"));
?>
<tr>
<td colspan="2" valign="top">
<!-- //? -->
<table id="BASKET_TABLE" cellpadding="3" cellspacing="1" border="0" width="100%" class="internal">
<tr class="heading">
<?php
echo getColumnsHeaders($arUserColumns, "detail", false);
?>
</tr>
<?
$bXmlId = COption::GetOptionString("sale", "show_order_product_xml_id", "N");
$arCurFormat = CCurrencyLang::GetCurrencyFormat($arOrder["CURRENCY"]);
$CURRENCY_FORMAT = trim(str_replace("#", '', $arCurFormat["FORMAT_STRING"]));
$ORDER_TOTAL_PRICE = 0;
$ORDER_TOTAL_WEIGHT = 0;
$arFilterRecomendet = array();
$arBasketProps = array();
$bUseCatalog = (CModule::IncludeModule("catalog")) ? true : false;
$bUseIblock = (CModule::IncludeModule("iblock")) ? true : false;
$arBasketItems = getMeasures($arBasketItems);
if(!empty($arBasketId))
{
//select props from basket
$arPropsFilter = array("BASKET_ID" => $arBasketId);
示例5: GetFormatDescription
public static function GetFormatDescription($currency)
{
$boolAdminSection = (defined('ADMIN_SECTION') && ADMIN_SECTION === true);
$currency = (string)$currency;
if (!isset(self::$arCurrencyFormat[$currency]))
{
$arCurFormat = CCurrencyLang::GetCurrencyFormat($currency);
if ($arCurFormat === false)
{
$arCurFormat = self::$arDefaultValues;
}
else
{
if (!isset($arCurFormat['DECIMALS']))
$arCurFormat['DECIMALS'] = self::$arDefaultValues['DECIMALS'];
$arCurFormat['DECIMALS'] = (int)$arCurFormat['DECIMALS'];
if (!isset($arCurFormat['DEC_POINT']))
$arCurFormat['DEC_POINT'] = self::$arDefaultValues['DEC_POINT'];
if (!empty($arCurFormat['THOUSANDS_VARIANT']) && isset(self::$arSeparators[$arCurFormat['THOUSANDS_VARIANT']]))
{
$arCurFormat['THOUSANDS_SEP'] = self::$arSeparators[$arCurFormat['THOUSANDS_VARIANT']];
}
elseif (!isset($arCurFormat['THOUSANDS_SEP']))
{
$arCurFormat['THOUSANDS_SEP'] = self::$arDefaultValues['THOUSANDS_SEP'];
}
if (!isset($arCurFormat['FORMAT_STRING']))
{
$arCurFormat['FORMAT_STRING'] = self::$arDefaultValues['FORMAT_STRING'];
}
elseif ($boolAdminSection)
{
$arCurFormat["FORMAT_STRING"] = strip_tags(preg_replace(
'#<script[^>]*?>.*?</script[^>]*?>#is',
'',
$arCurFormat["FORMAT_STRING"]
));
}
if (!isset($arCurFormat['HIDE_ZERO']) || empty($arCurFormat['HIDE_ZERO']))
$arCurFormat['HIDE_ZERO'] = self::$arDefaultValues['HIDE_ZERO'];
}
self::$arCurrencyFormat[$currency] = $arCurFormat;
}
else
{
$arCurFormat = self::$arCurrencyFormat[$currency];
}
return $arCurFormat;
}
示例6: GetProductSku
//.........這裏部分代碼省略.........
$arSkuTmp = array();
$arOffer["CAN_BUY"] = "N";
$arCatalogProduct = CCatalogProduct::GetByID($arOffer['ID']);
if (!empty($arCatalogProduct)) {
if ($arCatalogProduct["CAN_BUY_ZERO"] != "Y" && ($arCatalogProduct["QUANTITY_TRACE"] == "Y" && doubleval($arCatalogProduct["QUANTITY"]) <= 0)) {
$arOffer["CAN_BUY"] = "N";
} else {
$arOffer["CAN_BUY"] = "Y";
}
}
$arSkuTmp["ImageUrl"] = '';
if ($arOffer["CAN_BUY"] == "Y") {
$productImg = "";
if (isset($arImgSku[$arOffer['ID']]) && !empty($arImgSku[$arOffer['ID']])) {
if ('' == $PRODUCT_NAME) {
$PRODUCT_NAME = $arImgSku[$arOffer['ID']]["~NAME"];
}
if ($arImgSku[$arOffer['ID']]["PREVIEW_PICTURE"] != "") {
$productImg = $arImgSku[$arOffer['ID']]["PREVIEW_PICTURE"];
} elseif ($arImgSku[$arOffer['ID']]["DETAIL_PICTURE"] != "") {
$productImg = $arImgSku[$arOffer['ID']]["DETAIL_PICTURE"];
}
if ($productImg == "") {
if ($arProduct["PREVIEW_PICTURE"] != "") {
$productImg = $arProduct["PREVIEW_PICTURE"];
} elseif ($arProduct["DETAIL_PICTURE"] != "") {
$productImg = $arProduct["DETAIL_PICTURE"];
}
}
if ($productImg != "") {
$arFile = CFile::GetFileArray($productImg);
$productImg = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
$arSkuTmp["ImageUrl"] = $productImg["src"];
}
}
}
if ($minItemPrice === 0 || $arPrice["DISCOUNT_PRICE"] < $minItemPrice) {
$minItemPrice = $arPrice["DISCOUNT_PRICE"];
$minItemPriceFormat = SaleFormatCurrency($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"]);
}
foreach ($arIblockOfferProps as $arCode) {
if (array_key_exists($arCode["CODE"], $arOffer["PROPERTIES"])) {
if (is_array($arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"])) {
$arSkuTmp[] = implode("/", $arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"]);
} else {
$arSkuTmp[] = $arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"];
}
}
}
if (!empty($arCatalogProduct)) {
$arSkuTmp["BALANCE"] = $arCatalogProduct["QUANTITY"];
$arSkuTmp["WEIGHT"] = $arCatalogProduct["WEIGHT"];
$arSkuTmp["BARCODE_MULTI"] = $arCatalogProduct["BARCODE_MULTI"];
} else {
$arSkuTmp["BALANCE"] = 0;
$arSkuTmp["WEIGHT"] = 0;
$arSkuTmp["BARCODE_MULTI"] = 'N';
}
$urlEdit = CIBlock::GetAdminElementEditLink($arOffer["IBLOCK_ID"], $arOffer['ID'], array('find_section_section' => 0, 'WF' => 'Y'));
$discountPercent = 0;
$arSkuTmp["USER_ID"] = $USER_ID;
$arSkuTmp["ID"] = $arOffer["ID"];
$arSkuTmp["NAME"] = CUtil::JSEscape($arOffer["NAME"]);
$arSkuTmp["PRODUCT_NAME"] = CUtil::JSEscape($PRODUCT_NAME);
$arSkuTmp["PRODUCT_ID"] = $PRODUCT_ID;
$arSkuTmp["LID"] = CUtil::JSEscape($LID);
$arSkuTmp["MIN_PRICE"] = $minItemPriceFormat;
$arSkuTmp["URL_EDIT"] = $urlEdit;
$arSkuTmp["DISCOUNT_PRICE"] = '';
$arSkuTmp["DISCOUNT_PRICE_FORMATED"] = '';
$arSkuTmp["PRICE"] = $arPrice["PRICE"]["PRICE"];
$arSkuTmp["PRICE_FORMATED"] = CCurrencyLang::CurrencyFormat($arPrice["PRICE"]["PRICE"], $arPrice["PRICE"]["CURRENCY"], false);
$arPriceType = GetCatalogGroup($arPrice["PRICE"]["CATALOG_GROUP_ID"]);
$arSkuTmp["PRICE_TYPE"] = $arPriceType["NAME_LANG"];
$arSkuTmp["VAT_RATE"] = $arPrice["PRICE"]["VAT_RATE"];
if (count($arPrice["DISCOUNT"]) > 0) {
$discountPercent = IntVal($arPrice["DISCOUNT"]["VALUE"]);
$arSkuTmp["DISCOUNT_PRICE"] = $arPrice["DISCOUNT_PRICE"];
$arSkuTmp["DISCOUNT_PRICE_FORMATED"] = CCurrencyLang::CurrencyFormat($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"], false);
}
$arCurFormat = CCurrencyLang::GetCurrencyFormat($arPrice["PRICE"]["CURRENCY"]);
$arSkuTmp["VALUTA_FORMAT"] = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
$arSkuTmp["DISCOUNT_PERCENT"] = $discountPercent;
$arSkuTmp["CURRENCY"] = $arPrice["PRICE"]["CURRENCY"];
$arSkuTmp["CAN_BUY"] = $arOffer["CAN_BUY"];
$arSku[] = $arSkuTmp;
}
if ((!is_array($arIblockOfferProps) || empty($arIblockOfferProps)) && is_array($arSku) && !empty($arSku)) {
$arIblockOfferProps[0] = array("CODE" => "TITLE", "NAME" => GetMessage("SKU_TITLE"));
foreach ($arSku as $key => $val) {
$arSku[$key][0] = $val["NAME"];
}
}
$arResult["SKU_ELEMENTS"] = $arSku;
$arResult["SKU_PROPERTIES"] = $arIblockOfferProps;
$arResult["OFFERS_IBLOCK_ID"] = $arOffersIblock[$arProduct["IBLOCK_ID"]];
}
//if OFFERS_IBLOCK_ID > 0
return $arResult;
}
示例7: array
}
$pdf->Ln();
}
/*
$pdf->Write(15, CSalePdf::prepareToPdf(sprintf(
"Грузополучатель: %s ИНН %s, %s",
CSalePaySystemAction::GetParamValue("BUYER_NAME", false),
CSalePaySystemAction::GetParamValue("BUYER_INN", false),
CSalePaySystemAction::GetParamValue("BUYER_ADDRESS", false)
)));
$pdf->Ln();
*/
// Список товаров
$dbBasket = CSaleBasket::GetList(array("DATE_INSERT" => "ASC", "NAME" => "ASC"), array("ORDER_ID" => $ORDER_ID), false, false, array("ID", "PRICE", "CURRENCY", "QUANTITY", "NAME", "VAT_RATE", "MEASURE_NAME"));
if ($arBasket = $dbBasket->Fetch()) {
$arCurFormat = CCurrencyLang::GetCurrencyFormat($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"]);
$currency = trim(str_replace('#', '', $arCurFormat['FORMAT_STRING']));
$arColsCaption = array(1 => CSalePdf::prepareToPdf('№'), CSalePdf::prepareToPdf('Наименование товара'), CSalePdf::prepareToPdf('Кол-во'), CSalePdf::prepareToPdf('Ед.'), CSalePdf::prepareToPdf('Цена, ' . $currency), CSalePdf::prepareToPdf('Ставка НДС'), CSalePdf::prepareToPdf('Сумма, ' . $currency));
$arCells = array();
$arProps = array();
$arRowsWidth = array(1 => 0, 0, 0, 0, 0, 0, 0);
for ($i = 1; $i <= 7; $i++) {
$arRowsWidth[$i] = max($arRowsWidth[$i], $pdf->GetStringWidth($arColsCaption[$i]));
}
$n = 0;
$sum = 0.0;
$vat = 0;
do {
// props in product basket
$arProdProps = array();
$dbBasketProps = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "DESC"), array("BASKET_ID" => $arBasket["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")), false, false, array("ID", "BASKET_ID", "NAME", "VALUE", "CODE", "SORT"));
示例8: ConvertMoney
public static function ConvertMoney($sum, $srcCurrencyID, $dstCurrencyID, $srcExchRate = -1)
{
$sum = doubleval($sum);
if (!CModule::IncludeModule('currency')) {
return $sum;
}
$srcCurrencyID = self::NormalizeCurrencyID($srcCurrencyID);
$dstCurrencyID = self::NormalizeCurrencyID($dstCurrencyID);
$srcExchRate = doubleval($srcExchRate);
if ($sum === 0.0 || $srcCurrencyID === $dstCurrencyID) {
return $sum;
}
$result = 0;
if ($srcExchRate < 0) {
// Use default exchenge rate
$result = CCurrencyRates::ConvertCurrency($sum, $srcCurrencyID, $dstCurrencyID);
} else {
// Convert source currency to base and convert base currency to destination
$result = CCurrencyRates::ConvertCurrency(doubleval($sum * $srcExchRate), self::GetBaseCurrencyID(), $dstCurrencyID);
}
$decimals = 2;
$formatInfo = CCurrencyLang::GetCurrencyFormat($dstCurrencyID);
if (isset($formatInfo['DECIMALS'])) {
$decimals = intval($formatInfo['DECIMALS']);
}
$result = round($result, $decimals);
return $result;
}
示例9: roundEx
}
$currentDiscount = roundEx($currentDiscount, CATALOG_VALUE_PRECISION);
if ($arPrice["DISCOUNT"]["VALUE_TYPE"] == "S") {
$currentPrice = $currentDiscount;
} else {
$currentPrice = $currentPrice - $currentDiscount;
}
}
$vatRate = $arPrice["PRICE"]["VAT_RATE"];
$fieldValue = FormatCurrency($currentPrice, $arPrice["PRICE"]["CURRENCY"]);
if (DoubleVal($nearestQuantity) != DoubleVal($QUANTITY)) {
$fieldValue .= str_replace("#CNT#", $nearestQuantity, GetMessage("SOPS_PRICE1"));
}
}
if (strlen($BASE_LANG_CURR) <= 0) {
$arCurFormat = CCurrencyLang::GetCurrencyFormat($arPrice["PRICE"]["CURRENCY"]);
$priceValutaFormat = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
}
$row->AddField("PRICE", $fieldValue);
$arCatalogProduct = CCatalogProduct::GetByID($arItems["ID"]);
$balance = FloatVal($arCatalogProduct["QUANTITY"]);
$row->AddField("BALANCE", $balance);
$URL = CIBlock::ReplaceDetailUrl($arItems["DETAIL_PAGE_URL"], $arItems, true);
$arPriceType = GetCatalogGroup($arPrice["PRICE"]["CATALOG_GROUP_ID"]);
$PriceType = $arPriceType["NAME_LANG"];
$productImg = "";
if ($arItems["PREVIEW_PICTURE"] != "") {
$productImg = $arItems["PREVIEW_PICTURE"];
} elseif ($arItems["DETAIL_PICTURE"] != "") {
$productImg = $arItems["DETAIL_PICTURE"];
}
示例10: empty
//получаем цену в зависимости от скидки
$discountPrice = false;
if ($arDiscounts) {
$discountPrice = CCatalogProduct::CountPriceWithDiscount($el["CATALOG_PURCHASING_PRICE"], $el["CATALOG_PURCHASING_CURRENCY"], $arDiscounts);
}
// путь к директории, где хранятся изображения
$imageId = empty($el["DETAIL_PICTURE"]) ? $el["PREVIEW_PICTURE"] : $el["DETAIL_PICTURE"];
if (!empty($imageId)) {
/*Неэффективный кусок кода*/
$sPath = CFile::GetByID($imageId)->GetNext();
/**********************************/
$sPath = "/" . $strImageStorePath . "/" . $sPath["SUBDIR"] . "/" . $sPath["FILE_NAME"];
} else {
$sPath = "";
}
$price = CCurrencyLang::GetCurrencyFormat($el["CATALOG_PURCHASING_CURRENCY"], "ru")["FORMAT_STRING"];
$arResult[$el["ID"]] = $el;
$arResult[$el["ID"]]["PRICE"] = str_replace("#", $el["CATALOG_PURCHASING_PRICE"], $price);
$arResult[$el["ID"]]["PRICE_WITH_DISCOUNT"] = $discountPrice ? str_replace("#", $discountPrice, $price) : "";
$arResult[$el["ID"]]["PRODUCT_ID"] = $iProductId;
/*Неэффективный кусок кода*/
$arResult[$el["ID"]]["ARTNUMBER"] = CIBlockElement::GetProperty($el["IBLOCK_ID"], $el["ID"], array(), array("CODE" => "ARTNUMBER"))->GetNext()["VALUE"];
//Получение артикула, для каждого инфоблока свой артикул, поэтому нельзя выбрать для всех сразу
/**********************************/
$arResult[$el["ID"]]["IMAGE"] = $sPath;
/***Получение количества товара с учетом наличия его на складе***/
$arProd = (int) CCatalogStoreProduct::GetList(array(), array('PRODUCT_ID' => $iProductId, "STORE_ID" => 1), false, false, array('AMOUNT'))->GetNext()['AMOUNT'];
$arResult[$el["ID"]]["QUANTITY"] = $arProd <= 0 || $arResult[$el["ID"]]['CATALOG_QUANTITY'] <= 0 ? 0 : $arResult[$el["ID"]]['CATALOG_QUANTITY'];
unset($arProd);
/****Получение ссылок редактирования и удаления элемента из публичной части****/
$arButtons = CIBlock::GetPanelButtons($el["IBLOCK_ID"], $el["ID"], 0, array("SECTION_BUTTONS" => false, "SESSID" => false));
示例11: trim
null,
null,
null,
null,
$vat <= 0 ? "Всього без ПДВ:" : "Всього:",
SaleFormatCurrency(
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"],
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
true
)
);
$showVat = false;
}
$arCurFormat = CCurrencyLang::GetCurrencyFormat($GLOBALS['SALE_INPUT_PARAMS']['ORDER']['CURRENCY']);
$currency = trim(str_replace('#', '', $arCurFormat['FORMAT_STRING']));
?>
<table class="it" width="100%">
<tr>
<td><nobr>№</nobr></td>
<td><nobr>Товар/Послуга</nobr></td>
<td><nobr>Кіл-сть</nobr></td>
<td><nobr>Од.</nobr></td>
<td><nobr><? if ($vat <= 0) { ?>Ціна без ПДВ<? } else { ?>Ціна з ПДВ<? } ?>, <?php
echo $currency;
?>
</nobr></td>
<? if ($showVat) { ?>
<td><nobr>Ставка ПДВ</nobr></td>
<? } ?>
示例12: getSaleFormatCurrency
protected function getSaleFormatCurrency($price, $currency)
{
$currency = (string) $currency;
$arCurFormat = CCurrencyLang::GetCurrencyFormat($currency, $this->getLanguageId());
$arDefaultValues = CCurrencyLang::GetDefaultValues();
$arSeparators = CCurrencyLang::GetSeparators();
if ($arCurFormat === false) {
$arCurFormat = $arDefaultValues;
} else {
if (!isset($arCurFormat['DECIMALS'])) {
$arCurFormat['DECIMALS'] = $arDefaultValues['DECIMALS'];
}
$arCurFormat['DECIMALS'] = (int) $arCurFormat['DECIMALS'];
if (!isset($arCurFormat['DEC_POINT'])) {
$arCurFormat['DEC_POINT'] = $arDefaultValues['DEC_POINT'];
}
if (!empty($arCurFormat['THOUSANDS_VARIANT']) && isset($arSeparators[$arCurFormat['THOUSANDS_VARIANT']])) {
$arCurFormat['THOUSANDS_SEP'] = $arSeparators[$arCurFormat['THOUSANDS_VARIANT']];
} elseif (!isset($arCurFormat['THOUSANDS_SEP'])) {
$arCurFormat['THOUSANDS_SEP'] = $arDefaultValues['THOUSANDS_SEP'];
}
if (!isset($arCurFormat['FORMAT_STRING'])) {
$arCurFormat['FORMAT_STRING'] = $arDefaultValues['FORMAT_STRING'];
}
if (!isset($arCurFormat['HIDE_ZERO']) || empty($arCurFormat['HIDE_ZERO'])) {
$arCurFormat['HIDE_ZERO'] = $arDefaultValues['HIDE_ZERO'];
}
}
$intDecimals = $arCurFormat['DECIMALS'];
if ($arCurFormat['HIDE_ZERO'] == 'Y') {
if (round($price, $arCurFormat["DECIMALS"]) == round($price, 0)) {
$intDecimals = 0;
}
}
$price = number_format($price, $intDecimals, $arCurFormat['DEC_POINT'], $arCurFormat['THOUSANDS_SEP']);
if ($arCurFormat['THOUSANDS_VARIANT'] == CCurrencyLang::SEP_NBSPACE) {
$price = str_replace(' ', ' ', $price);
}
return str_replace('#', $price, $arCurFormat['FORMAT_STRING']);
}
示例13: array
//http://jabber.bx/view.php?id=37744
$arProdIdsPrIds = array();
while ($arBasket = $dbBasket->GetNext()) {
$arProdIds[] = $arBasket["PRODUCT_ID"];
$arProdIdsPrIds[$arBasket["PRODUCT_ID"]] = $arBasket["ID"];
if ($bXmlId == "N") {
$arPropsFilter["!CODE"] = array("PRODUCT.XML_ID", "CATALOG.XML_ID");
}
$arBasket["PROPS"] = array();
$dbBasketProps = CSaleBasket::GetPropsList(array("BASKET_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), array("BASKET_ID" => $arBasket["ID"]), false, false, array("ID", "BASKET_ID", "NAME", "VALUE", "CODE", "SORT"));
while ($arBasketProps = $dbBasketProps->GetNext()) {
$arBasket["PROPS"][$arBasketProps["ID"]] = $arBasketProps;
}
$arResult["BASKET"][$arBasket["ID"]] = $arBasket;
$arResult["BASKET"][$arBasket["ID"]]["BALANCE"] = "0";
$arCurFormat = CCurrencyLang::GetCurrencyFormat($arBasket["CURRENCY"]);
$CURRENCY_FORMAT = trim(str_replace("#", '', $arCurFormat["FORMAT_STRING"]));
$priceDiscount = $priceBase = $arBasket["DISCOUNT_PRICE"] + $arBasket["PRICE"];
if (DoubleVal($priceBase) > 0) {
$priceDiscount = roundEx($arBasket["DISCOUNT_PRICE"] * 100 / $priceBase, SALE_VALUE_PRECISION);
}
$arResult["BASKET"][$arBasket["ID"]]["PRICE_STRING"] = CurrencyFormatNumber($arBasket["PRICE"], $arBasket["CURRENCY"]) . " " . $CURRENCY_FORMAT;
if ($arBasket["DISCOUNT_PRICE"] > 0) {
$arResult["BASKET"][$arBasket["ID"]]["OLD_PRICE_STRING"] = CurrencyFormatNumber($priceBase, $arBasket["CURRENCY"]) . " " . $CURRENCY_FORMAT;
$arResult["BASKET"][$arBasket["ID"]]["DISCOUNT_STRING"] = $priceDiscount . "%";
}
$weight += $arBasket["WEIGHT"] * $arBasket["QUANTITY"];
$price += $arBasket["PRICE"] * $arBasket["QUANTITY"];
$price_total += ($arBasket["PRICE"] + $arBasket["DISCOUNT_PRICE"]) * $arBasket["QUANTITY"];
}
$arResult["WEIGHT"] = $weight;