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


PHP CCatalogDiscountSave::Disable方法代码示例

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


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

示例1: PreGenerateExport

 function PreGenerateExport($profile_id)
 {
     global $DB;
     $profile_id = intval($profile_id);
     if ($profile_id <= 0) {
         return false;
     }
     $ar_profile = CCatalogExport::GetByID($profile_id);
     if (!$ar_profile || 'Y' == $ar_profile['NEED_EDIT']) {
         return false;
     }
     if ($ar_profile["DEFAULT_PROFILE"] != "Y") {
         parse_str($ar_profile["SETUP_VARS"]);
     }
     CCatalogDiscountSave::Disable();
     $strFile = CATALOG_PATH2EXPORTS . $ar_profile["FILE_NAME"] . "_run.php";
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
         $strFile = CATALOG_PATH2EXPORTS_DEF . $ar_profile["FILE_NAME"] . "_run.php";
         if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
             return false;
         }
     }
     @(include $_SERVER["DOCUMENT_ROOT"] . $strFile);
     CCatalogDiscountSave::Enable();
     CCatalogExport::Update($profile_id, array("=LAST_USE" => $DB->GetNowFunction()));
     return "CCatalogExport::PreGenerateExport(" . $profile_id . ");";
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:27,代码来源:catalog_export.php

示例2: PreGenerateImport

 public static function PreGenerateImport($profile_id)
 {
     global $DB;
     $profile_id = (int) $profile_id;
     if ($profile_id <= 0) {
         return false;
     }
     $ar_profile = CCatalogImport::GetByID($profile_id);
     if (!$ar_profile || 'Y' == $ar_profile['NEED_EDIT']) {
         return false;
     }
     $strFile = CATALOG_PATH2IMPORTS . $ar_profile["FILE_NAME"] . "_run.php";
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
         $strFile = CATALOG_PATH2IMPORTS_DEF . $ar_profile["FILE_NAME"] . "_run.php";
         if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
             CCatalogDiscountSave::Enable();
             return false;
         }
     }
     $bFirstLoadStep = true;
     if (!defined("CATALOG_LOAD_NO_STEP")) {
         define("CATALOG_LOAD_NO_STEP", true);
     }
     $strImportErrorMessage = "";
     $strImportOKMessage = "";
     $bAllDataLoaded = true;
     $arSetupVars = array();
     $intSetupVarsCount = 0;
     if ('Y' != $ar_profile["DEFAULT_PROFILE"]) {
         parse_str($ar_profile["SETUP_VARS"], $arSetupVars);
         if (!empty($arSetupVars) && is_array($arSetupVars)) {
             $intSetupVarsCount = extract($arSetupVars, EXTR_SKIP);
         }
     }
     global $arCatalogAvailProdFields;
     $arCatalogAvailProdFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_ELEMENT);
     global $arCatalogAvailPriceFields;
     $arCatalogAvailPriceFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_CATALOG);
     global $arCatalogAvailValueFields;
     $arCatalogAvailValueFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE);
     global $arCatalogAvailQuantityFields;
     $arCatalogAvailQuantityFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE_EXT);
     global $arCatalogAvailGroupFields;
     $arCatalogAvailGroupFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_SECTION);
     global $defCatalogAvailProdFields;
     $defCatalogAvailProdFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_ELEMENT);
     global $defCatalogAvailPriceFields;
     $defCatalogAvailPriceFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CATALOG);
     global $defCatalogAvailValueFields;
     $defCatalogAvailValueFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE);
     global $defCatalogAvailQuantityFields;
     $defCatalogAvailQuantityFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE_EXT);
     global $defCatalogAvailGroupFields;
     $defCatalogAvailGroupFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_SECTION);
     global $defCatalogAvailCurrencies;
     $defCatalogAvailCurrencies = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CURRENCY);
     CCatalogDiscountSave::Disable();
     include $_SERVER["DOCUMENT_ROOT"] . $strFile;
     CCatalogDiscountSave::Enable();
     CCatalogImport::Update($profile_id, array("=LAST_USE" => $DB->GetNowFunction()));
     return "CCatalogImport::PreGenerateImport(" . $profile_id . ");";
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:62,代码来源:catalog_import.php

示例3: array

     $arSelectedFields[] = "DETAIL_TEXT_TYPE";
 }
 $arSelectedFields[] = "LOCK_STATUS";
 $arSelectedFields[] = "WF_NEW";
 $arSelectedFields[] = "WF_STATUS_ID";
 $arSelectedFields[] = "DETAIL_PAGE_URL";
 $arSelectedFields[] = "SITE_ID";
 $arSelectedFields[] = "CODE";
 $arSelectedFields[] = "EXTERNAL_ID";
 $arSelectedFields[] = "NAME";
 $arSelectedFields[] = "XML_ID";
 $arSelectedFields[] = "IBLOCK_ID";
 $arDiscountCoupons = array();
 $arSku = array();
 $OfferIblockId = "";
 CCatalogDiscountSave::Disable();
 $arCatalogProductResult = array();
 $arPricesResult = array();
 $arCatalogProduct = $arItemsResult = $arPricesResult = array();
 while ($arItems = $dbResultList->Fetch()) {
     $arCatalogProduct[] = $arItems["ID"];
     $arItems['DETAIL_PAGE_URL'] = CIBlock::ReplaceDetailUrl($arItems['DETAIL_PAGE_URL'], $arItems, false, "E");
     $arItemsResult[$arItems['ID']] = $arItems;
 }
 if (!empty($arCatalogProduct)) {
     foreach ($arPrices as $price) {
         $dbPrice = CPrice::GetList(array(), array('PRODUCT_ID' => $arCatalogProduct, 'CATALOG_GROUP_ID' => $price['ID']), false, false, array('PRODUCT_ID', 'PRICE'));
         while ($arPrice = $dbPrice->fetch()) {
             $arPricesResult[$price['ID']][$arPrice["PRODUCT_ID"]] = $arPrice["PRICE"];
         }
     }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:cat_store_product_search.php

示例4: CatalogGetPriceTable

function CatalogGetPriceTable($ID)
{
    global $USER;
    $ID = (int) $ID;
    if ($ID <= 0) {
        return false;
    }
    $arResult = array();
    $arPriceGroups = array();
    $cacheKey = LANGUAGE_ID . "_" . $USER->GetGroups();
    if (isset($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"]) && is_array($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"]) && isset($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey]) && is_array($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey])) {
        $arPriceGroups = $GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey];
    } else {
        $dbPriceGroupsList = CCatalogGroup::GetList(array("SORT" => "ASC"), array("CAN_ACCESS" => "Y", "LID" => LANGUAGE_ID), array("ID", "NAME_LANG", "SORT"), false, array("ID", "NAME_LANG", "CAN_BUY", "SORT"));
        while ($arPriceGroupsList = $dbPriceGroupsList->Fetch()) {
            $arPriceGroups[] = $arPriceGroupsList;
            $GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey][] = $arPriceGroupsList;
        }
    }
    if (empty($arPriceGroups)) {
        return false;
    }
    $arBorderMap = array();
    $arPresentGroups = array();
    $bMultiQuantity = False;
    $dbPrice = CPrice::GetList(array("QUANTITY_FROM" => "ASC", "QUANTITY_TO" => "ASC", "SORT" => "ASC"), array("PRODUCT_ID" => $ID), false, false, array("ID", "CATALOG_GROUP_ID", "PRICE", "CURRENCY", "QUANTITY_FROM", "QUANTITY_TO", "ELEMENT_IBLOCK_ID", "SORT"));
    while ($arPrice = $dbPrice->Fetch()) {
        CCatalogDiscountSave::Disable();
        $arDiscounts = CCatalogDiscount::GetDiscount($ID, $arPrice["ELEMENT_IBLOCK_ID"], $arPrice["CATALOG_GROUP_ID"], $USER->GetUserGroupArray(), "N", SITE_ID, array());
        CCatalogDiscountSave::Enable();
        $discountPrice = CCatalogProduct::CountPriceWithDiscount($arPrice["PRICE"], $arPrice["CURRENCY"], $arDiscounts);
        $arPrice["DISCOUNT_PRICE"] = $discountPrice;
        if (array_key_exists($arPrice["QUANTITY_FROM"] . "-" . $arPrice["QUANTITY_TO"], $arBorderMap)) {
            $jnd = $arBorderMap[$arPrice["QUANTITY_FROM"] . "-" . $arPrice["QUANTITY_TO"]];
        } else {
            $jnd = count($arBorderMap);
            $arBorderMap[$arPrice["QUANTITY_FROM"] . "-" . $arPrice["QUANTITY_TO"]] = $jnd;
        }
        $arResult[$jnd]["QUANTITY_FROM"] = DoubleVal($arPrice["QUANTITY_FROM"]);
        $arResult[$jnd]["QUANTITY_TO"] = DoubleVal($arPrice["QUANTITY_TO"]);
        if (DoubleVal($arPrice["QUANTITY_FROM"]) > 0 || DoubleVal($arPrice["QUANTITY_TO"]) > 0) {
            $bMultiQuantity = True;
        }
        $arResult[$jnd]["PRICE"][$arPrice["CATALOG_GROUP_ID"]] = $arPrice;
    }
    $numGroups = count($arPriceGroups);
    for ($i = 0; $i < $numGroups; $i++) {
        $bNeedKill = True;
        for ($j = 0, $intCount = count($arResult); $j < $intCount; $j++) {
            if (!array_key_exists($arPriceGroups[$i]["ID"], $arResult[$j]["PRICE"])) {
                $arResult[$j]["PRICE"][$arPriceGroups[$i]["ID"]] = False;
            }
            if ($arResult[$j]["PRICE"][$arPriceGroups[$i]["ID"]] != false) {
                $bNeedKill = False;
            }
        }
        if ($bNeedKill) {
            for ($j = 0, $intCount = count($arResult); $j < $intCount; $j++) {
                unset($arResult[$j]["PRICE"][$arPriceGroups[$i]["ID"]]);
            }
            unset($arPriceGroups[$i]);
        }
    }
    return array("COLS" => $arPriceGroups, "MATRIX" => $arResult, "MULTI_QUANTITY" => $bMultiQuantity ? "Y" : "N");
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:65,代码来源:include.php

示例5: GetProductData


//.........这里部分代码省略.........
         $quantity = 1;
     }
     if (!($arCatalogProduct = static::getHitCache('CATALOG_PRODUCT', $productID))) {
         $rsProducts = CCatalogProduct::GetList(array(), array('ID' => $productID), false, false, array('ID', 'CAN_BUY_ZERO', 'QUANTITY_TRACE', 'QUANTITY', 'WEIGHT', 'WIDTH', 'HEIGHT', 'LENGTH', 'BARCODE_MULTI', 'TYPE'));
         if ($arCatalogProduct = $rsProducts->Fetch()) {
             static::setHitCache('CATALOG_PRODUCT', $productID, $arCatalogProduct);
         }
         unset($rsProducts);
     }
     if (!empty($arCatalogProduct) && is_array($arCatalogProduct)) {
         $dblQuantity = doubleval($arCatalogProduct["QUANTITY"]);
         $boolQuantity = 'Y' != $arCatalogProduct["CAN_BUY_ZERO"] && 'Y' == $arCatalogProduct["QUANTITY_TRACE"];
         if ($arParams["CHECK_QUANTITY"] == "Y" && $boolQuantity && 0 >= $dblQuantity) {
             $APPLICATION->ThrowException(Loc::getMessage("CATALOG_NO_QUANTITY_PRODUCT", array("#NAME#" => htmlspecialcharsbx($arProduct["~NAME"]))), "CATALOG_NO_QUANTITY_PRODUCT");
             return $arResult;
         }
     } else {
         $APPLICATION->ThrowException(Loc::getMessage("CATALOG_ERR_NO_PRODUCT"), "CATALOG_NO_QUANTITY_PRODUCT");
         return $arResult;
     }
     if ($arParams["CHECK_PRICE"] == "Y") {
         $productHash = array('MODULE' => 'catalog', 'PRODUCT_ID' => $productID, 'BASKET_ID' => $arParams['BASKET_ID']);
         $arCoupons = array();
         if ($arParams['CHECK_COUPONS'] == 'Y') {
             $arCoupons = DiscountCouponsManager::getForApply(array(), $productHash, true);
             if (!empty($arCoupons)) {
                 $arCoupons = array_keys($arCoupons);
             }
         }
         if ($adminSection) {
             if ($intUserID > 0) {
                 CCatalogDiscountSave::SetDiscountUserID($intUserID);
             } else {
                 CCatalogDiscountSave::Disable();
             }
         }
         $currentVatMode = CCatalogProduct::getPriceVatIncludeMode();
         $currentUseDiscount = CCatalogProduct::getUseDiscount();
         CCatalogProduct::setUseDiscount($arParams['CHECK_DISCOUNT'] == 'Y');
         CCatalogProduct::setPriceVatIncludeMode(true);
         CCatalogProduct::setUsedCurrency($arParams['CURRENCY']);
         $arPrice = CCatalogProduct::GetOptimalPrice($productID, $quantity, $userGroups, $arParams['RENEWAL'], array(), $adminSection ? $strSiteID : false, $arCoupons);
         if (empty($arPrice)) {
             if ($nearestQuantity = CCatalogProduct::GetNearestQuantityPrice($productID, $quantity, $userGroups)) {
                 $quantity = $nearestQuantity;
                 $arPrice = CCatalogProduct::GetOptimalPrice($productID, $quantity, $userGroups, $arParams['RENEWAL'], array(), $adminSection ? $strSiteID : false, $arCoupons);
             }
         }
         CCatalogProduct::clearUsedCurrency();
         CCatalogProduct::setPriceVatIncludeMode($currentVatMode);
         CCatalogProduct::setUseDiscount($currentUseDiscount);
         unset($userGroups, $currentUseDiscount, $currentVatMode);
         if ($adminSection) {
             if ($intUserID > 0) {
                 CCatalogDiscountSave::ClearDiscountUserID();
             } else {
                 CCatalogDiscountSave::Enable();
             }
         }
         if (empty($arPrice)) {
             return $arResult;
         }
         $arDiscountList = array();
         if (empty($arPrice['DISCOUNT_LIST']) && !empty($arPrice['DISCOUNT']) && is_array($arPrice['DISCOUNT'])) {
             $arPrice['DISCOUNT_LIST'] = array($arPrice['DISCOUNT']);
         }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:67,代码来源:product_provider.php

示例6: GetItemPrices

	public static function GetItemPrices($IBLOCK_ID, $arCatalogPrices, $arItem, $bVATInclude = true, $arCurrencyParams = array(), $USER_ID = 0, $LID = SITE_ID)
	{
		$arPrices = array();

		if (empty($arCatalogPrices) || !is_array($arCatalogPrices))
		{
			return $arPrices;
		}

		global $USER;
		static $arCurUserGroups = array();
		static $strBaseCurrency = '';

		if (self::$catalogIncluded === null)
			self::$catalogIncluded = \Freetrix\Main\Loader::includeModule('catalog');
		if (self::$catalogIncluded)
		{
			$USER_ID = intval($USER_ID);
			$intUserID = $USER_ID;
			if (0 >= $intUserID)
				$intUserID = $USER->GetID();
			if (!isset($arCurUserGroups[$intUserID]))
			{
				$arUserGroups = (0 < $USER_ID ? CUser::GetUserGroup($USER_ID) : $USER->GetUserGroupArray());
				CatalogClearArray($arUserGroups);
				$arCurUserGroups[$intUserID] = $arUserGroups;
			}
			else
			{
				$arUserGroups = $arCurUserGroups[$intUserID];
			}

			$boolConvert = false;
			$strCurrencyID = '';
			if (isset($arCurrencyParams['CURRENCY_ID']) && !empty($arCurrencyParams['CURRENCY_ID']))
			{
				$boolConvert = true;
				$strCurrencyID = $arCurrencyParams['CURRENCY_ID'];
			}
			if (!$boolConvert && '' == $strBaseCurrency)
				$strBaseCurrency = CCurrency::GetBaseCurrency();

			$strMinCode = '';
			$boolStartMin = true;
			$dblMinPrice = 0;
			$strMinCurrency = ($boolConvert ? $strCurrencyID : $strBaseCurrency);
			CCatalogDiscountSave::Disable();
			foreach($arCatalogPrices as $key => $value)
			{
				if($value["CAN_VIEW"] && strlen($arItem["CATALOG_PRICE_".$value["ID"]]) > 0)
				{
					// get final price with VAT included.
					if ($arItem['CATALOG_VAT_INCLUDED'] != 'Y')
					{
						$arItem['CATALOG_PRICE_'.$value['ID']] *= (1 + $arItem['CATALOG_VAT'] * 0.01);
					}
					// so discounts will include VAT
					$arDiscounts = CCatalogDiscount::GetDiscount(
						$arItem["ID"],
						$arItem["IBLOCK_ID"],
						array($value["ID"]),
						$arUserGroups,
						"N",
						$LID,
						array()
					);
					$discountPrice = CCatalogProduct::CountPriceWithDiscount(
						$arItem["CATALOG_PRICE_".$value["ID"]],
						$arItem["CATALOG_CURRENCY_".$value["ID"]],
						$arDiscounts
					);
					// get clear prices WO VAT
					$arItem['CATALOG_PRICE_'.$value['ID']] /= (1 + $arItem['CATALOG_VAT'] * 0.01);
					$discountPrice /= (1 + $arItem['CATALOG_VAT'] * 0.01);

					$vat_value_discount = $discountPrice * $arItem['CATALOG_VAT'] * 0.01;
					$vat_discountPrice = $discountPrice + $vat_value_discount;

					$vat_value = $arItem['CATALOG_PRICE_'.$value['ID']] * $arItem['CATALOG_VAT'] * 0.01;
					$vat_price = $arItem["CATALOG_PRICE_".$value["ID"]] + $vat_value;

					if ($boolConvert && $strCurrencyID != $arItem["CATALOG_CURRENCY_".$value["ID"]])
					{
						$strOrigCurrencyID = $arItem["CATALOG_CURRENCY_".$value["ID"]];
						$dblOrigNoVat = $arItem["CATALOG_PRICE_".$value["ID"]];
						$dblNoVat = CCurrencyRates::ConvertCurrency($dblOrigNoVat, $strOrigCurrencyID, $strCurrencyID);
						$dblVatPrice = CCurrencyRates::ConvertCurrency($vat_price, $strOrigCurrencyID, $strCurrencyID);
						$dblVatValue = CCurrencyRates::ConvertCurrency($vat_value, $strOrigCurrencyID, $strCurrencyID);
						$dblDiscountValueNoVat = CCurrencyRates::ConvertCurrency($discountPrice, $strOrigCurrencyID, $strCurrencyID);
						$dblVatDiscountPrice = CCurrencyRates::ConvertCurrency($vat_discountPrice, $strOrigCurrencyID, $strCurrencyID);
						$dblDiscountValueVat = CCurrencyRates::ConvertCurrency($vat_value_discount, $strOrigCurrencyID, $strCurrencyID);

						$arPrices[$key] = array(
							'ORIG_VALUE_NOVAT' => $dblOrigNoVat,
							"VALUE_NOVAT" => $dblNoVat,
							"PRINT_VALUE_NOVAT" => CCurrencyLang::CurrencyFormat($dblNoVat, $strCurrencyID, true),

							'ORIG_VALUE_VAT' => $vat_price,
							"VALUE_VAT" => $dblVatPrice,
							"PRINT_VALUE_VAT" => CCurrencyLang::CurrencyFormat($dblVatPrice, $strCurrencyID, true),
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:open_bx,代码行数:101,代码来源:comp_pricetools.php

示例7: GetItemPrices

	public static function GetItemPrices($IBLOCK_ID, $arCatalogPrices, $arItem, $bVATInclude = true, $arCurrencyParams = array(), $USER_ID = 0, $LID = SITE_ID)
	{
		static $arCurUserGroups = array();

		global $USER;
		$arPrices = array();
		if(CModule::IncludeModule("catalog"))
		{
			$USER_ID = intval($USER_ID);
			$intUserID = $USER_ID;
			if (0 >= $intUserID)
				$intUserID = $USER->GetID();
			if (!array_key_exists($intUserID, $arCurUserGroups))
			{
				$arCurUserGroups[$intUserID] = (0 < $USER_ID ? CUser::GetUserGroup($USER_ID) : $USER->GetUserGroupArray());
			}
			$arUserGroups = $arCurUserGroups[$intUserID];

			$boolConvert = false;
			$strCurrencyID = '';
			if (is_array($arCurrencyParams) && !empty($arCurrencyParams) && !empty($arCurrencyParams['CURRENCY_ID']))
			{
				$boolConvert = true;
				$strCurrencyID = $arCurrencyParams['CURRENCY_ID'];
			}
			foreach($arCatalogPrices as $key => $value)
			{
				if($value["CAN_VIEW"] && strlen($arItem["CATALOG_PRICE_".$value["ID"]]) > 0)
				{
					// get final price with VAT included.
					if ($arItem['CATALOG_VAT_INCLUDED'] != 'Y')
					{
						$arItem['CATALOG_PRICE_'.$value['ID']] *= (1 + $arItem['CATALOG_VAT'] * 0.01);
					}
					CCatalogDiscountSave::Disable();
					// so discounts will include VAT
					$arDiscounts = CCatalogDiscount::GetDiscount(
						$arItem["ID"],
						$arItem["IBLOCK_ID"],
						array($value["ID"]),
						$arUserGroups,
						"N",
						$LID,
						array()
					);
					CCatalogDiscountSave::Enable();
					$discountPrice = CCatalogProduct::CountPriceWithDiscount(
						$arItem["CATALOG_PRICE_".$value["ID"]],
						$arItem["CATALOG_CURRENCY_".$value["ID"]],
						$arDiscounts
					);
					// get clear prices WO VAT
					$arItem['CATALOG_PRICE_'.$value['ID']] /= (1 + $arItem['CATALOG_VAT'] * 0.01);
					$discountPrice /= (1 + $arItem['CATALOG_VAT'] * 0.01);

					$vat_value_discount = $discountPrice * $arItem['CATALOG_VAT'] * 0.01;
					$vat_discountPrice = $discountPrice + $vat_value_discount;

					$vat_value = $arItem['CATALOG_PRICE_'.$value['ID']] * $arItem['CATALOG_VAT'] * 0.01;
					$vat_price = $arItem["CATALOG_PRICE_".$value["ID"]] + $vat_value;

					if ($boolConvert && $strCurrencyID != $arItem["CATALOG_CURRENCY_".$value["ID"]])
					{
						$strOrigCurrencyID = $arItem["CATALOG_CURRENCY_".$value["ID"]];
						$dblOrigNoVat = $arItem["CATALOG_PRICE_".$value["ID"]];
						$dblNoVat = CCurrencyRates::ConvertCurrency($dblOrigNoVat, $strOrigCurrencyID, $strCurrencyID);
						$dblVatPrice = CCurrencyRates::ConvertCurrency($vat_price, $strOrigCurrencyID, $strCurrencyID);
						$dblVatValue = CCurrencyRates::ConvertCurrency($vat_value, $strOrigCurrencyID, $strCurrencyID);
						$dblDiscountValueNoVat = CCurrencyRates::ConvertCurrency($discountPrice, $strOrigCurrencyID, $strCurrencyID);
						$dblVatDiscountPrice = CCurrencyRates::ConvertCurrency($vat_discountPrice, $strOrigCurrencyID, $strCurrencyID);
						$dblDiscountValueVat = CCurrencyRates::ConvertCurrency($vat_value_discount, $strOrigCurrencyID, $strCurrencyID);

						$arPrices[$key] = array(
							'ORIG_VALUE_NOVAT' => $dblOrigNoVat,
							"VALUE_NOVAT" => $dblNoVat,
							"PRINT_VALUE_NOVAT" => FormatCurrency($dblNoVat, $strCurrencyID),

							'ORIG_VALUE_VAT' => $vat_price,
							"VALUE_VAT" => $dblVatPrice,
							"PRINT_VALUE_VAT" => FormatCurrency($dblVatPrice, $strCurrencyID),

							'ORIG_VATRATE_VALUE' => $vat_value,
							"VATRATE_VALUE" => $dblVatValue,
							"PRINT_VATRATE_VALUE" => FormatCurrency($dblVatValue, $strCurrencyID),

							'ORIG_DISCOUNT_VALUE_NOVAT' => $discountPrice,
							"DISCOUNT_VALUE_NOVAT" => $dblDiscountValueNoVat,
							"PRINT_DISCOUNT_VALUE_NOVAT" => FormatCurrency($dblDiscountValueNoVat, $strCurrencyID),

							"ORIG_DISCOUNT_VALUE_VAT" => $vat_discountPrice,
							"DISCOUNT_VALUE_VAT" => $dblVatDiscountPrice,
							"PRINT_DISCOUNT_VALUE_VAT" => FormatCurrency($dblVatDiscountPrice, $strCurrencyID),

							'ORIG_DISCOUNT_VATRATE_VALUE' => $vat_value_discount,
							'DISCOUNT_VATRATE_VALUE' => $dblDiscountValueVat,
							'PRINT_DISCOUNT_VATRATE_VALUE' => FormatCurrency($dblDiscountValueVat, $strCurrencyID),

							'ORIG_CURRENCY' => $strOrigCurrencyID,
							"CURRENCY" => $strCurrencyID,
						);
//.........这里部分代码省略.........
开发者ID:nProfessor,项目名称:Mytb,代码行数:101,代码来源:comp_pricetools.php

示例8: PreGenerateImport

	/**
	 * <p>Метод выполняет профиль <i>profile_id</i> на агенте.</p>
	 *
	 *
	 *
	 *
	 * @param int $profile_id  Код выполняемого профиля.
	 *
	 *
	 *
	 * @return mixed <p>В случае успешного выполнения профиля импорта метод возвращает
	 * строку для следующего вызова агента. В противном случае метод
	 * вернет <i>false</i>.</p><br><br>
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogimport/pregenerateimport.php
	 * @author Bitrix
	 */
	public static function PreGenerateImport($profile_id)
	{
		global $DB;

		$profile_id = intval($profile_id);
		if ($profile_id <= 0)
			return false;

		$ar_profile = CCatalogImport::GetByID($profile_id);
		if ((!$ar_profile) || ('Y' == $ar_profile['NEED_EDIT']))
			return false;

		$strFile = CATALOG_PATH2IMPORTS.$ar_profile["FILE_NAME"]."_run.php";
		if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
		{
			$strFile = CATALOG_PATH2IMPORTS_DEF.$ar_profile["FILE_NAME"]."_run.php";
			if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
			{
				CCatalogDiscountSave::Enable();
				return false;
			}
		}

		$bFirstLoadStep = true;

		if (!defined("CATALOG_LOAD_NO_STEP"))
			// define("CATALOG_LOAD_NO_STEP", true);

		$strImportErrorMessage = "";
		$strImportOKMessage = "";

		$bAllDataLoaded = true;

		$arSetupVars = array();
		$intSetupVarsCount = 0;
		if ('Y' != $ar_profile["DEFAULT_PROFILE"])
		{
			parse_str($ar_profile["SETUP_VARS"], $arSetupVars);
			if (!empty($arSetupVars) && is_array($arSetupVars))
			{
				$intSetupVarsCount = extract($arSetupVars, EXTR_SKIP);
			}
		}

		CCatalogDiscountSave::Disable();
		include($_SERVER["DOCUMENT_ROOT"].$strFile);
		CCatalogDiscountSave::Enable();

		CCatalogImport::Update($profile_id, array(
			"=LAST_USE" => $DB->GetNowFunction()
			)
		);

		return "CCatalogImport::PreGenerateImport(".$profile_id.");";
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:73,代码来源:catalog_import.php

示例9: PreGenerateImport

 function PreGenerateImport($profile_id)
 {
     global $DB;
     $profile_id = IntVal($profile_id);
     if ($profile_id <= 0) {
         return false;
     }
     $ar_profile = CCatalogImport::GetByID($profile_id);
     if (!$ar_profile || 'Y' == $ar_profile['NEED_EDIT']) {
         return false;
     }
     if ($ar_profile["DEFAULT_PROFILE"] != "Y") {
         parse_str($ar_profile["SETUP_VARS"]);
     }
     $bFirstLoadStep = True;
     if (!defined("CATALOG_LOAD_NO_STEP")) {
         define("CATALOG_LOAD_NO_STEP", true);
     }
     CCatalogDiscountSave::Disable();
     $strFile = CATALOG_PATH2IMPORTS . $ar_profile["FILE_NAME"] . "_run.php";
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
         $strFile = CATALOG_PATH2IMPORTS_DEF . $ar_profile["FILE_NAME"] . "_run.php";
         if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
             CCatalogDiscountSave::Enable();
             return false;
         }
     }
     $strImportErrorMessage = "";
     $strImportOKMessage = "";
     $bAllDataLoaded = True;
     @(include $_SERVER["DOCUMENT_ROOT"] . $strFile);
     CCatalogDiscountSave::Enable();
     CCatalogImport::Update($profile_id, array("=LAST_USE" => $DB->GetNowFunction()));
     return "CCatalogImport::PreGenerateImport(" . $profile_id . ");";
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:35,代码来源:catalog_import.php

示例10: PreGenerateExport

	/**
	 * <p>Метод выполняет профиль <i>profile_id</i> на агенте.</p>
	 *
	 *
	 *
	 *
	 * @param int $profile_id  Код выполняемого профиля.
	 *
	 *
	 *
	 * @return mixed <p>В случае успешного выполнения профиля экспорта метод
	 * возвращает строку для следующего вызова агента. В противном
	 * случае метод вернет <i>false</i>.</p><br><br>
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogexport/pregenerateexport.php
	 * @author Bitrix
	 */
	public static function PreGenerateExport($profile_id)
	{
		global $DB;

		$profile_id = intval($profile_id);
		if ($profile_id<=0) return false;

		$ar_profile = CCatalogExport::GetByID($profile_id);
		if ((!$ar_profile) || ('Y' == $ar_profile['NEED_EDIT']))
			return false;

		$strFile = CATALOG_PATH2EXPORTS.$ar_profile["FILE_NAME"]."_run.php";
		if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
		{
			$strFile = CATALOG_PATH2EXPORTS_DEF.$ar_profile["FILE_NAME"]."_run.php";
			if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
			{
				return false;
			}
		}

		$arSetupVars = array();
		$intSetupVarsCount = 0;
		if ('Y' != $ar_profile["DEFAULT_PROFILE"])
		{
			parse_str($ar_profile["SETUP_VARS"], $arSetupVars);
			if (!empty($arSetupVars) && is_array($arSetupVars))
			{
				$intSetupVarsCount = extract($arSetupVars, EXTR_SKIP);
			}
		}

		CCatalogDiscountSave::Disable();
		include($_SERVER["DOCUMENT_ROOT"].$strFile);
		CCatalogDiscountSave::Enable();

		CCatalogExport::Update($profile_id, array(
			"=LAST_USE" => $DB->GetNowFunction()
			)
		);

		return "CCatalogExport::PreGenerateExport(".$profile_id.");";
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:61,代码来源:catalog_export.php


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