本文整理汇总了PHP中CSaleOrderTax::CountTaxes方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderTax::CountTaxes方法的具体用法?PHP CSaleOrderTax::CountTaxes怎么用?PHP CSaleOrderTax::CountTaxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderTax
的用法示例。
在下文中一共展示了CSaleOrderTax::CountTaxes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$total_sum = 0;
foreach ($arBasketOrder as $arBasket) {
$nds_val = 0;
$taxRate = 0;
if (floatval($arQuantities[$i]) <= 0) {
$arQuantities[$i] = DoubleVal($arBasket["QUANTITY"]);
}
$b_AMOUNT = DoubleVal($arBasket["PRICE"]);
//определяем начальную цену
$item_price = $b_AMOUNT;
if (DoubleVal($arBasket["VAT_RATE"]) > 0) {
$nds_val = $b_AMOUNT - DoubleVal($b_AMOUNT / (1 + $arBasket["VAT_RATE"]));
$item_price = $b_AMOUNT - $nds_val;
$taxRate = $arBasket["VAT_RATE"] * 100;
} elseif (!$bUseVat) {
$basket_tax = CSaleOrderTax::CountTaxes($b_AMOUNT * $arQuantities[$i], $arTaxList, $arOrder["CURRENCY"]);
for ($mi = 0, $countTaxList = count($arTaxList); $mi < $countTaxList; $mi++) {
if ($arTaxList[$mi]["IS_IN_PRICE"] == "Y") {
$item_price -= $arTaxList[$mi]["TAX_VAL"];
}
$nds_val += DoubleVal($arTaxList[$mi]["TAX_VAL"]);
$taxRate += $arTaxList[$mi]["VALUE"];
}
}
?>
<tr>
<td><?php
echo $i + 1;
?>
</td>
<td>
示例2: DoProcessOrderDelivery
static function DoProcessOrderDelivery(&$arOrder, $arOptions, &$arErrors)
{
if ((!array_key_exists("TAX_LOCATION", $arOrder) || intval($arOrder["TAX_LOCATION"]) <= 0) && (!$arOrder["USE_VAT"] || $arOrder["USE_VAT"] != "Y")) {
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"] || $arOrder["USE_VAT"] != "Y") {
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"]);
$arOrder["TAX_PRICE"] = 0;
foreach ($arOrder["TAX_LIST"] as &$arTax) {
$arTax["VALUE_MONEY"] += roundEx($arTax["TAX_VAL"], SALE_VALUE_PRECISION);
$arTax['VALUE_MONEY_FORMATED'] = SaleFormatCurrency($arTax["VALUE_MONEY"], $arOrder["CURRENCY"]);
if ($arTax["IS_IN_PRICE"] != "Y") {
$arOrder["TAX_PRICE"] += $arTax["VALUE_MONEY"];
}
}
unset($arTax);
}
} else {
$deliveryVat = $arOrder["DELIVERY_PRICE"] * $arOrder["VAT_RATE"] / (1 + $arOrder["VAT_RATE"]);
$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");
//}
}
$arOrder["TAX_PRICE"] = roundEx($arOrder["TAX_PRICE"], SALE_VALUE_PRECISION);
$arOrder["VAT_SUM"] = roundEx($arOrder["VAT_SUM"], SALE_VALUE_PRECISION);
$arOrder["VAT_DELIVERY"] = roundEx($arOrder["VAT_DELIVERY"], SALE_VALUE_PRECISION);
}
示例3: DoubleVal
<p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;
text-align:center;line-height:normal'> </p>
</td>
</tr>
<?php
$mi++;
}
if (DoubleVal($arOrder["PRICE_DELIVERY"]) > 0) {
$nds_val = 0.0;
$nds_pr = 0;
if (DoubleVal($arTaxList[0]["VALUE_MONEY"]) == DoubleVal($total_nds)) {
$item_price = DoubleVal($arOrder["PRICE_DELIVERY"]);
//$nds_val = 0.00;
//$nds_pr = 0;
} else {
$basket_tax = CSaleOrderTax::CountTaxes(DoubleVal($arOrder["PRICE_DELIVERY"]), $arTaxList, $arOrder["CURRENCY"]);
//определяем начальную цену
$item_price = DoubleVal($arOrder["PRICE_DELIVERY"]);
for ($i = 0; $i < count($arTaxList); $i++) {
if ($arTaxList[$i]["IS_IN_PRICE"] == "Y") {
$item_price -= $arTaxList[$i]["TAX_VAL"];
}
$nds_val += $arTaxList[$i]["TAX_VAL"];
$nds_pr += $arTaxList[$i]["VALUE"];
//
//$nds_val = 0.00;
//$nds_pr = 0;
//if($iNds > -1)
//{
// $nds_val = $arTaxList[$iNds]["TAX_VAL"];
// $nds_pr = $arTaxList[$iNds]["VALUE"];
示例4: count
//if ($arResult["arTaxList"][$j]=="Y")
if ($arResult["arTaxList"][$j]["IS_IN_PRICE"]=="Y")
{
$arResult["arTaxList"][$j]["VALUE_FORMATED"] = " (".(($arResult["arTaxList"][$j]["IS_PERCENT"]=="Y")?"".DoubleVal($arResult["arTaxList"][$j]["VALUE"])."%, ":" ").GetMessage("SOA_VAT_INCLUDED").")";
}
elseif ($arResult["arTaxList"][$j]["IS_PERCENT"]=="Y")
{
$arResult["arTaxList"][$j]["VALUE_FORMATED"] = " (".DoubleVal($arResult["arTaxList"][$j]["VALUE"])."%)";
}
}
}
if(DoubleVal($arResult["DELIVERY_PRICE"])>0 && $arParams["COUNT_DELIVERY_TAX"] == "Y")
{
$TAX_PRICE_tmp = CSaleOrderTax::CountTaxes(
$arResult["DELIVERY_PRICE"],
$arResult["arTaxList"],
$arResult["BASE_LANG_CURRENCY"]
);
$countResultTaxList = count($arResult["arTaxList"]);
for ($j = 0; $j < $countResultTaxList; $j++)
{
$arResult["arTaxList"][$j]["VALUE_MONEY"] += $arResult["arTaxList"][$j]["TAX_VAL"];
}
}
$countResultTax = count($arResult["arTaxList"]);
for ($j = 0; $j < $countResultTax; $j++)
{
$arResult["arTaxList"][$j]["VALUE_MONEY"] = roundEx($arResult["arTaxList"][$j]["VALUE_MONEY"], SALE_VALUE_PRECISION);
$arResult["arTaxList"][$j]["TAX_VAL"] = roundEx($arResult["arTaxList"][$j]["TAX_VAL"], SALE_VALUE_PRECISION);
示例5: foreach
$arDeliveryPrice[$i] = $deliveryPrice;
}
}
$checkDeliverySum = 0;
for ($i = 0; $i < count($arDeliveryPrice); $i++) {
$checkDeliverySum += $arDeliveryPrice[$i];
}
if ($deliveryPrice > $checkDeliverySum) {
$arDeliveryPrice[0] += $deliveryPrice - $checkDeliverySum;
}
}
if (count($arTaxList) > 0) {
//print_r($arDeliveryPrice);
if (!empty($deliveryPrice) && $COUNT_TAX_FOR_DELIVERY == "Y") {
foreach ($arDeliveryPrice as $i => $delPrice) {
$taxPrice = CSaleOrderTax::CountTaxes($delPrice, $arTaxList, $BASE_LANG_CURRENCY);
for ($j = 0; $j < count($arTaxList); $j++) {
$arOrderTaxList[$i][$j]["VALUE_MONEY"] += $arTaxList[$j]["TAX_VAL"];
$arTaxPrice[$i] = $arOrderTaxList[$i][0]["VALUE_MONEY"];
$arTaxList[$j]["VALUE_MONEY"] += $arTaxList[$j]["TAX_VAL"];
}
}
}
}
}
/***** /DELIVERY *****/
if (strlen($errorMessage) <= 0) {
$arIDs = array();
$arIDs[0] = $ID;
$sumPaid = DoubleVal(str_replace(",", ".", $SUM_PAID));
for ($i = 0; $i < count($arBasketList); $i++) {
示例6: NextPayment
//.........这里部分代码省略.........
"ACTIVE" => "Y",
"LOCATION" => $taxLocation
)
);
while ($arTaxRateTmp = $dbTaxRateTmp->Fetch())
{
if (!in_array(IntVal($arTaxRateTmp["TAX_ID"]), $arTaxExempt))
{
$arTaxList[] = $arTaxRateTmp;
}
}
}
else
{
$arTaxList[] = Array(
"ID" => 0,
"TAX_NAME" => GetMessage("SKGR_VAT"),
"IS_PERCENT" => "Y",
"VALUE" => $vatRate*100,
"VALUE_MONEY" => 0,
"APPLY_ORDER" => 100,
"IS_IN_PRICE" => "Y",
"CODE" => "VAT"
);
}
$arTaxSums = array();
if (!empty($arTaxList))
{
if(!$bUseVat)
{
$taxPriceTmp = CSaleOrderTax::CountTaxes(
$discountPrice * DoubleVal($arProduct["QUANTITY"]),
$arTaxList,
$baseSiteCurrency
);
for ($di = 0, $intCount = count($arTaxList); $di < $intCount; $di++)
{
$arTaxList[$di]["VALUE_MONEY"] += $arTaxList[$di]["TAX_VAL"];
}
for ($di = 0, $intCount = count($arTaxList); $di < $intCount; $di++)
{
$arTaxSums[$arTaxList[$di]["TAX_ID"]]["VALUE"] = $arTaxList[$di]["VALUE_MONEY"];
$arTaxSums[$arTaxList[$di]["TAX_ID"]]["NAME"] = $arTaxList[$di]["NAME"];
if ($arTaxList[$di]["IS_IN_PRICE"] != "Y")
{
$taxPrice += $arTaxList[$di]["VALUE_MONEY"];
}
}
}
else
{
$arTaxList[0]["VALUE_MONEY"] = (($discountPrice / ($vatRate +1)) * $vatRate) * DoubleVal($arProduct["QUANTITY"]);
$taxVatPrice = $arTaxList[0]["VALUE_MONEY"];
}
}
// Changed by Sigurd, 2007-08-16
$totalOrderPrice = $discountPrice * DoubleVal($arProduct["QUANTITY"]) + $deliveryPrice + $taxPrice;
$arProduct["WITHOUT_ORDER"] = (($arProduct["WITHOUT_ORDER"]=="Y") ? "Y" : "N");