• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CSaleOrderTax类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Update

 function Update($ID, $arFields)
 {
     global $DB;
     $ID = IntVal($ID);
     if (!CSaleOrderTax::CheckFields("UPDATE", $arFields)) {
         return false;
     }
     $strUpdate = $DB->PrepareUpdate("b_sale_order_tax", $arFields);
     $strSql = "UPDATE b_sale_order_tax SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     return $ID;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:12,代码来源:order_tax.php


示例2: Add

 function Add($arFields)
 {
     global $DB;
     if (!CSaleOrderTax::CheckFields("ADD", $arFields)) {
         return false;
     }
     $arInsert = $DB->PrepareInsert("b_sale_order_tax", $arFields);
     $strSql = "INSERT INTO b_sale_order_tax(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = IntVal($DB->LastID());
     return $ID;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:12,代码来源:order_tax.php


示例3: Add

 function Add($arFields)
 {
     global $DB;
     if (!CSaleOrderTax::CheckFields("ADD", $arFields)) {
         return false;
     }
     $dbResult = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $arFields['ORDER_ID'], "TAX_NAME" => $arFields['TAX_NAME'], "CODE" => $arFields['CODE']), false, false, array("ID"));
     if ($dbResult->Fetch()) {
         return false;
     }
     $arInsert = $DB->PrepareInsert("b_sale_order_tax", $arFields);
     $strSql = "INSERT INTO b_sale_order_tax(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = IntVal($DB->LastID());
     return $ID;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:16,代码来源:order_tax.php


示例4: nodeHandler

	function nodeHandler(CDataXML $value)
	{
		$value = $value->GetArray();

		if(!empty($value[GetMessage("CC_BSC1_DOCUMENT")]))
		{
			$value = $value[GetMessage("CC_BSC1_DOCUMENT")];

			$arOrder = $this->collectOrderInfo($value);

			if(!empty($arOrder))
			{
				if(strlen($arOrder["ID"]) <= 0 && strlen($arOrder["ID_1C"]) > 0)//try to search order from 1C
				{
					$dbOrder = CSaleOrder::GetList(array("ID" => "DESC"), array("ID_1C" => $arOrder["ID_1C"]), false, false, array("ID", "ID_1C"));
					if($orderInfo = $dbOrder->Fetch())
					{
						$arOrder["ID"] = $orderInfo["ID"];
					}
				}
				if(strlen($arOrder["ID"]) > 0) // exists site order
				{
					$dbOrder = CSaleOrder::GetList(array(), array("ACCOUNT_NUMBER" => $arOrder["ID"]), false, false, array("ID", "LID", "PERSON_TYPE_ID", "PAYED", "DATE_PAYED", "CANCELED", "DATE_CANCELED", "REASON_CANCELED", "STATUS_ID", "DATE_STATUS", "PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE", "PRICE_DELIVERY", "ALLOW_DELIVERY", "DATE_ALLOW_DELIVERY", "PRICE", "CURRENCY", "DISCOUNT_VALUE", "USER_ID", "PAY_SYSTEM_ID", "DELIVERY_ID", "DATE_INSERT", "DATE_INSERT_FORMAT", "DATE_UPDATE", "USER_DESCRIPTION", "ADDITIONAL_INFO", "COMMENTS", "TAX_VALUE", "DELIVERY_DOC_NUM", "DELIVERY_DOC_DATE", "STORE_ID", "ACCOUNT_NUMBER", "VERSION", "VERSION_1C", "ID_1C"));
					if($orderInfo = $dbOrder->Fetch())
					{
						if($arOrder["VERSION_1C"] != $orderInfo["VERSION_1C"] || (strlen($orderInfo["VERSION_1C"]) <= 0 || strlen($arOrder["VERSION_1C"]) <= 0)) // skip update if the same version
						{
							$arOrderFields = array();
							$orderId = $orderInfo["ID"];
							CSaleOrderChange::AddRecord($orderId, "ORDER_1C_IMPORT");
							if($arOrder["ID_1C"] != $orderInfo["ID_1C"])
								$arOrderFields["ID_1C"] = $arOrder["ID_1C"];
							$arOrderFields["VERSION_1C"] = $arOrder["VERSION_1C"];

							if($orderInfo["PAYED"] != "Y" && $orderInfo["ALLOW_DELIVERY"] != "Y" && $orderInfo["STATUS_ID"] != "F")
							{
								$dbOrderTax = CSaleOrderTax::GetList(
									array(),
									array("ORDER_ID" => $orderId),
									false,
									false,
									array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE")
								);
								$bTaxFound = false;
								if($arOrderTax = $dbOrderTax->Fetch())
								{
									$bTaxFound = true;
									if(IntVal($arOrderTax["VALUE_MONEY"]) != IntVal($arOrder["TAX"]["VALUE_MONEY"]) || IntVal($arOrderTax["VALUE"]) != IntVal($arOrder["TAX"]["VALUE"]) || ($arOrderTax["IS_IN_PRICE"] != $arOrder["TAX"]["IS_IN_PRICE"]))
									{
										if(IntVal($arOrder["TAX"]["VALUE"])>0)
										{
											$arFields = Array(
												"TAX_NAME" => $arOrder["TAX"]["NAME"],
												"ORDER_ID" => $orderId,
												"VALUE" => $arOrder["TAX"]["VALUE"],
												"IS_PERCENT" => "Y",
												"IS_IN_PRICE" => $arOrder["TAX"]["IS_IN_PRICE"],
												"VALUE_MONEY" => $arOrder["TAX"]["VALUE_MONEY"],
												"CODE" => "VAT1C",
												"APPLY_ORDER" => "100"
											);
											CSaleOrderTax::Update($arOrderTax["ID"], $arFields);
											$arOrderFields["TAX_VALUE"] = $arOrder["TAX"]["VALUE_MONEY"];
										}
										else
										{
											CSaleOrderTax::Delete($arOrderTax["ID"]);
											$arOrderFields["TAX_VALUE"] = 0;
										}
									}
								}

								if(!$bTaxFound)
								{
									if(IntVal($arOrder["TAX"]["VALUE"])>0)
									{
										$arFields = Array(
											"TAX_NAME" => $arOrder["TAX"]["NAME"],
											"ORDER_ID" => $orderId,
											"VALUE" => $arOrder["TAX"]["VALUE"],
											"IS_PERCENT" => "Y",
											"IS_IN_PRICE" => $arOrder["TAX"]["IS_IN_PRICE"],
											"VALUE_MONEY" => $arOrder["TAX"]["VALUE_MONEY"]
										);
										CSaleOrderTax::Add($arFields);
										$arOrderFields["TAX_VALUE"] = $arOrder["TAX"]["VALUE_MONEY"];
									}
								}

								$arShoppingCart = array();
								$bNeedUpdate = false;
								$dbBasket = CSaleBasket::GetList(
									array("NAME" => "ASC"),
									array("ORDER_ID" => $orderId),
									false,
									false,
									array(
										"ID",
										"QUANTITY",
										"CANCEL_CALLBACK_FUNC",
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:101,代码来源:order_loader.php


示例5: ExportOrders2Xml


//.........这里部分代码省略.........
				{
					?><DateUpdate><?php 
echo $DB->FormatDate($arOrder["DATE_UPDATE"], $dateFormat, "YYYY-MM-DD HH:MI:SS");
?>
</DateUpdate><?
				}

				$deliveryAdr = CSaleExport::ExportContragents(
					$arOrder, $arProp, $agent, $arResultStat, $bNewVersion,
					$bExportFromCrm ? array("EXPORT_FROM_CRM" => "Y") : array()
				);
				?>
				<<?php 
echo GetMessage("SALE_EXPORT_TIME");
?>
><?php 
echo $DB->FormatDate($arOrder["DATE_INSERT_FORMAT"], $dateFormat, "HH:MI:SS");
?>
</<?php 
echo GetMessage("SALE_EXPORT_TIME");
?>
>
				<<?php 
echo GetMessage("SALE_EXPORT_COMMENTS");
?>
><?php 
echo htmlspecialcharsbx($arOrder["COMMENTS"]);
?>
</<?php 
echo GetMessage("SALE_EXPORT_COMMENTS");
?>
>
				<?
				$dbOrderTax = CSaleOrderTax::GetList(
					array(),
					array("ORDER_ID" => $arOrder["ID"]),
					false,
					false,
					array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE")
				);
				$i=-1;
				$orderTax = 0;
				while ($arOrderTax = $dbOrderTax->Fetch())
				{
					$arOrderTax["VALUE_MONEY"] = roundEx($arOrderTax["VALUE_MONEY"], 2);
					$orderTax += $arOrderTax["VALUE_MONEY"];
					$i++;
					if($i == 0)
						echo "<".GetMessage("SALE_EXPORT_TAXES").">";
					?>
					<<?php 
echo GetMessage("SALE_EXPORT_TAX");
?>
>
						<<?php 
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
><?php 
echo htmlspecialcharsbx($arOrderTax["TAX_NAME"]);
?>
</<?php 
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
>
						<<?php 
echo GetMessage("SALE_EXPORT_IN_PRICE");
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:67,代码来源:export.php


示例6: count

				if (empty($arResult["ERROR"]))
				{
					$countResultTax = count($arResult["arTaxList"]);
					for ($i = 0; $i < $countResultTax; $i++)
					{
						$arFields = array(
								"ORDER_ID" => $arResult["ORDER_ID"],
								"TAX_NAME" => $arResult["arTaxList"][$i]["NAME"],
								"IS_PERCENT" => $arResult["arTaxList"][$i]["IS_PERCENT"],
								"VALUE" => ($arResult["arTaxList"][$i]["IS_PERCENT"]=="Y") ? $arResult["arTaxList"][$i]["VALUE"] : RoundEx(CCurrencyRates::ConvertCurrency($arResult["arTaxList"][$i]["VALUE"], $arResult["arTaxList"][$i]["CURRENCY"], $arResult["BASE_LANG_CURRENCY"]), SALE_VALUE_PRECISION),
								"VALUE_MONEY" => $arResult["arTaxList"][$i]["VALUE_MONEY"],
								"APPLY_ORDER" => $arResult["arTaxList"][$i]["APPLY_ORDER"],
								"IS_IN_PRICE" => $arResult["arTaxList"][$i]["IS_IN_PRICE"],
								"CODE" => $arResult["arTaxList"][$i]["CODE"]
							);
						CSaleOrderTax::Add($arFields);
					}

					$arTmpUserPropsVal = Array();
					if(IntVal($arUserResult["PROFILE_ID"]) > 0)
					{
						$dbUserPropsValues = CSaleOrderUserPropsValue::GetList(
								array("SORT" => "ASC"),
								array(
									"USER_PROPS_ID" => $arUserResult["PROFILE_ID"],
								),
								false,
								false,
								array("ORDER_PROPS_ID", "ID", "SORT")
							);
						while($arUserPropsValues = $dbUserPropsValues->Fetch())
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:component.php


示例7: number_format

    }
    ?>

					<tr>
						<td align="right" colspan="4">
							Сумма:
						</td>
						<td align="right" nowrap>
							<?php 
    echo number_format($total_sum, 2, ',', ' ');
    ?>
						</td>
					</tr>

					<?php 
    $db_tax_list = CSaleOrderTax::GetList(array("APPLY_ORDER" => "ASC"), array("ORDER_ID" => $ORDER_ID));
    while ($ar_tax_list = $db_tax_list->Fetch()) {
        ?>
						<tr>
							<td align="right" colspan="4">
								<?php 
        if ($ar_tax_list["IS_IN_PRICE"] == "Y") {
            echo "В том числе ";
        }
        echo htmlspecialcharsbx($ar_tax_list["TAX_NAME"]);
        if ($ar_tax_list["IS_PERCENT"] == "Y") {
            echo " (" . $ar_tax_list["VALUE"] . "%)";
        }
        ?>
:
							</td>
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:order_form.php


示例8: _Delete

 function _Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     $bSuccess = True;
     foreach (GetModuleEvents("sale", "OnBeforeOrderDelete", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             return false;
         }
     }
     $DB->StartTransaction();
     if ($bSuccess) {
         $dbBasket = CSaleBasket::GetList(array(), array("ORDER_ID" => $ID));
         while ($arBasket = $dbBasket->Fetch()) {
             $bSuccess = CSaleBasket::Delete($arBasket["ID"]);
             if (!$bSuccess) {
                 break;
             }
         }
     }
     if ($bSuccess) {
         $dbRecurring = CSaleRecurring::GetList(array(), array("ORDER_ID" => $ID));
         while ($arRecurring = $dbRecurring->Fetch()) {
             $bSuccess = CSaleRecurring::Delete($arRecurring["ID"]);
             if (!$bSuccess) {
                 break;
             }
         }
     }
     if ($bSuccess) {
         $bSuccess = CSaleOrderPropsValue::DeleteByOrder($ID);
     }
     if ($bSuccess) {
         $bSuccess = CSaleOrderTax::DeleteEx($ID);
     }
     if ($bSuccess) {
         $bSuccess = CSaleUserTransact::DeleteByOrder($ID);
     }
     if ($bSuccess) {
         unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sale_order WHERE ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         $DB->Commit();
     } else {
         $DB->Rollback();
     }
     foreach (GetModuleEvents("sale", "OnOrderDelete", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $bSuccess));
     }
     return $bSuccess;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:54,代码来源:order.php


示例9: nodeHandler

 function nodeHandler(CDataXML $value)
 {
     $value = $value->GetArray();
     $value = $value[GetMessage("CC_BSC1_DOCUMENT")];
     if ($value["#"][GetMessage("CC_BSC1_OPERATION")][0]["#"] == GetMessage("CC_BSC1_ORDER")) {
         $orderId = IntVal($value["#"][GetMessage("CC_BSC1_NUMBER")][0]["#"]);
         $arOrder = array();
         $arItem = array();
         $arOrder["AMOUNT"] = $value["#"][GetMessage("CC_BSC1_SUMM")][0]["#"];
         $arOrder["AMOUNT"] = str_replace($SumFormat, ".", $arOrder["AMOUNT"]);
         $arOrder["COMMENT"] = $value["#"][GetMessage("CC_BSC1_COMMENT")][0]["#"];
         foreach ($value["#"][GetMessage("CC_BSC1_REK_VALUES")][0]["#"][GetMessage("CC_BSC1_REK_VALUE")] as $val) {
             $arOrder["TRAITS"][$val["#"][GetMessage("CC_BSC1_NAME")][0]["#"]] = $val["#"][GetMessage("CC_BSC1_VALUE")][0]["#"];
         }
         $taxValue = 0;
         $taxValueTmp = 0;
         $taxName = "";
         if (is_array($value["#"][GetMessage("CC_BSC1_ITEMS")][0]["#"][GetMessage("CC_BSC1_ITEM")])) {
             foreach ($value["#"][GetMessage("CC_BSC1_ITEMS")][0]["#"][GetMessage("CC_BSC1_ITEM")] as $val) {
                 $val = $val["#"];
                 $productID = $val[GetMessage("CC_BSC1_ID")][0]["#"];
                 $bGood = false;
                 $discountPrice = "";
                 $priceAll = str_replace($SumFormat, ".", $val[GetMessage("CC_BSC1_SUMM")][0]["#"]);
                 $priceone = str_replace($SumFormat, ".", $val[GetMessage("CC_BSC1_PRICE_PER_UNIT")][0]["#"]);
                 $quantity = str_replace($QuantityFormat, ".", $val[GetMessage("CC_BSC1_QUANTITY")][0]["#"]);
                 $price = $priceAll / $quantity;
                 if ($priceone != $price) {
                     $discountPrice = $priceone - $price;
                 }
                 //DISCOUNTS!
                 $arItem[$productID] = array("NAME" => $val[GetMessage("CC_BSC1_NAME")][0]["#"], "PRICE" => $price, "QUANTITY" => $quantity, "DISCOUNT_PRICE" => $discountPrice);
                 if (is_array($val[GetMessage("CC_BSC1_PROPS_ITEMS")][0]["#"][GetMessage("CC_BSC1_PROP_ITEM")])) {
                     foreach ($val[GetMessage("CC_BSC1_PROPS_ITEMS")][0]["#"][GetMessage("CC_BSC1_PROP_ITEM")] as $val1) {
                         $arItem[$productID]["ATTRIBUTES"][$val1["#"][GetMessage("CC_BSC1_NAME")][0]["#"]] = $val1["#"][GetMessage("CC_BSC1_VALUE")][0]["#"];
                     }
                 }
                 if (is_array($val[GetMessage("CC_BSC1_REK_VALUES")][0]["#"][GetMessage("CC_BSC1_REK_VALUE")])) {
                     foreach ($val[GetMessage("CC_BSC1_REK_VALUES")][0]["#"][GetMessage("CC_BSC1_REK_VALUE")] as $val1) {
                         if ($val1["#"][GetMessage("CC_BSC1_NAME")][0]["#"] == GetMessage("CC_BSC1_ITEM_TYPE")) {
                             $arItem[$productID]["TYPE"] = $val1["#"][GetMessage("CC_BSC1_VALUE")][0]["#"];
                         }
                     }
                 }
                 if (strlen($value["#"][GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_NAME")][0]["#"]) > 0) {
                     $taxValueTmp = $val[GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_TAX_VALUE")][0]["#"];
                     $arItem[$productID]["VAT_RATE"] = $taxValueTmp / 100;
                     if (IntVal($taxValueTmp) > IntVal($taxValue)) {
                         $taxName = $val[GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_NAME")][0]["#"];
                         $taxValue = $taxValueTmp;
                     }
                 }
             }
         }
         if (IntVal($taxValue) > 0) {
             $price = str_replace($SumFormat, ".", $value["#"][GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_SUMM")][0]["#"]);
             $arOrder["TAX"] = array("NAME" => $taxName, "VALUE" => $taxValue, "IS_IN_PRICE" => $value["#"][GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_IN_PRICE")][0]["#"] == "true" ? "Y" : "N", "VALUE_MONEY" => $price);
         }
         $arOrder["items"] = $arItem;
         $v = $arOrder;
         if ($orderInfo = CSaleOrder::GetByID($orderId)) {
             if ($orderInfo["PAYED"] != "Y" && $orderInfo["ALLOW_DELIVERY"] != "Y" && $orderInfo["STATUS_ID"] != "F") {
                 $dbOrderTax = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE"));
                 $bTaxFound = false;
                 if ($arOrderTax = $dbOrderTax->Fetch()) {
                     $bTaxFound = true;
                     if (IntVal($arOrderTax["VALUE_MONEY"]) != IntVal($v["TAX"]["VALUE_MONEY"]) || IntVal($arOrderTax["VALUE"]) != IntVal($v["TAX"]["VALUE"]) || $arOrderTax["IS_IN_PRICE"] != $v["TAX"]["IS_IN_PRICE"]) {
                         if (IntVal($v["TAX"]["VALUE"]) > 0) {
                             $arFields = array("TAX_NAME" => $v["TAX"]["NAME"], "ORDER_ID" => $orderId, "VALUE" => $v["TAX"]["VALUE"], "IS_PERCENT" => "Y", "IS_IN_PRICE" => $v["TAX"]["IS_IN_PRICE"], "VALUE_MONEY" => $v["TAX"]["VALUE_MONEY"], "CODE" => "VAT1C", "APPLY_ORDER" => "100");
                             CSaleOrderTax::Update($arOrderTax["ID"], $arFields);
                             CSaleOrder::Update($orderId, array("TAX_VALUE" => $v["TAX"]["VALUE_MONEY"]));
                         } else {
                             CSaleOrderTax::Delete($arOrderTax["ID"]);
                             CSaleOrder::Update($orderId, array("TAX_VALUE" => 0));
                         }
                     }
                 }
                 if (!$bTaxFound) {
                     if (IntVal($v["TAX"]["VALUE"]) > 0) {
                         $arFields = array("TAX_NAME" => $v["TAX"]["NAME"], "ORDER_ID" => $orderId, "VALUE" => $v["TAX"]["VALUE"], "IS_PERCENT" => "Y", "IS_IN_PRICE" => $v["TAX"]["IS_IN_PRICE"], "VALUE_MONEY" => $v["TAX"]["VALUE_MONEY"]);
                         CSaleOrderTax::Add($arFields);
                         CSaleOrder::Update($orderId, array("TAX_VALUE" => $v["TAX"]["VALUE_MONEY"]));
                     }
                 }
                 $dbBasket = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $orderId));
                 $basketSum = 0;
                 while ($arBasket = $dbBasket->Fetch()) {
                     $arFields = array();
                     if (!empty($v["items"][$arBasket["PRODUCT_XML_ID"]])) {
                         if ($arBasket["QUANTITY"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"]) {
                             $arFields["QUANTITY"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"];
                         }
                         if ($arBasket["PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"]) {
                             $arFields["PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"];
                         }
                         if ($arBasket["VAT_RATE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"]) {
                             $arFields["VAT_RATE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"];
                         }
                         if ($arBasket["DISCOUNT_PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"]) {
                             $arFields["DISCOUNT_PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"];
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:component.php


示例10: 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");
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:67,代码来源:recurring.php


示例11: getOrderTax

 function getOrderTax($orderId)
 {
     $arResult = array();
     if ($orderId > 0) {
         $dbOrderTax = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE"));
         $i = -1;
         $orderTax = 0;
         while ($arOrderTax = $dbOrderTax->Fetch()) {
             $arResult[] = $arOrderTax;
         }
     }
     return $arResult;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:13,代码来源:export.php


示例12: die

if (!isset($arFilter) || !is_array($arFilter)) {
    die("Wrong use 1");
}
$dbOrderList = CSaleOrder::GetList(array($by => $order), $arFilter, false, false, array("ID", "LID", "PERSON_TYPE_ID", "PAYED", "DATE_PAYED", "EMP_PAYED_ID", "CANCELED", "DATE_CANCELED", "EMP_CANCELED_ID", "REASON_CANCELED", "STATUS_ID", "DATE_STATUS", "PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE", "EMP_STATUS_ID", "PRICE_DELIVERY", "ALLOW_DELIVERY", "DATE_ALLOW_DELIVERY", "EMP_ALLOW_DELIVERY_ID", "PRICE", "CURRENCY", "DISCOUNT_VALUE", "SUM_PAID", "USER_ID", "PAY_SYSTEM_ID", "DELIVERY_ID", "DATE_INSERT", "DATE_INSERT_FORMAT", "DATE_UPDATE", "USER_DESCRIPTION", "ADDITIONAL_INFO", "PS_STATUS", "PS_STATUS_CODE", "PS_STATUS_DESCRIPTION", "PS_STATUS_MESSAGE", "PS_SUM", "PS_CURRENCY", "PS_RESPONSE_DATE", "COMMENTS", "TAX_VALUE", "STAT_GID", "RECURRING_ID"));
ob_start();
echo "<" . "?xml version=\"1.0\" encoding=\"" . LANG_CHARSET . "\"?" . ">\n";
echo "<BizTalk xmlns=\"urn:schemas-biztalk-org:biztalk/biztalk-0.81.xml\"><Route><From locationID=\"\" locationType=\"\" process=\"\" path=\"\" handle=\"\"/><To locationID=\"\" locationType=\"\" process=\"\" path=\"\" handle=\"\"/></Route><Body>\n";
echo "\t<" . GetMessage("CommerceInfo") . " xmlns=\"urn:CommerceML\">\n";
$arContra = array();
while ($dbOrderList->NavNext(true, "f_")) {
    echo "\t\t<" . GetMessage("Document") . " " . GetMessage("Operation") . "=\"Order\" " . GetMessage("NumberDoc") . "=\"" . $f_ID . "\" ";
    echo "" . GetMessage("DateDoc") . "=\"" . CDatabase::FormatDate($f_DATE_INSERT, CLang::GetDateFormat("FULL", LANG), "Y-M-D") . "\" " . GetMessage("TimeDoc") . "=\"" . CDatabase::FormatDate($f_DATE_INSERT, CLang::GetDateFormat("FULL", LANG), "HH:MI:SS") . "\" " . GetMessage("PaymentDate") . "=\"\" ";
    echo "" . GetMessage("Sum") . "=\"" . $f_PRICE . "\" " . GetMessage("Comment") . "=\"\" " . GetMessage("Currency") . "=\"" . $f_CURRENCY . "\">\n";
    echo "\t\t\t<" . GetMessage("CompanyInDocument") . " " . GetMessage("Role") . "=\"Saler\" " . GetMessage("Company") . "=\"" . $SALER_COMPANY_XML_ID . "\"/>\n";
    echo "\t\t\t<" . GetMessage("CompanyInDocument") . " " . GetMessage("Role") . "=\"Buyer\" " . GetMessage("Company") . "=\"BC" . $f_USER_ID . "\"/>\n";
    $dbOrderTax = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $f_ID), false, false, array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE"));
    while ($arOrderTax = $dbOrderTax->Fetch()) {
        echo "\t\t\t<" . GetMessage("TaxSum") . " " . GetMessage("Tax") . "=\"" . htmlspecialcharsbx($arOrderTax["TAX_NAME"]) . "\" " . GetMessage("TaxRate") . "=\"" . htmlspecialcharsbx($arOrderTax["VALUE"]) . "\" " . GetMessage("Sum") . "=\"" . htmlspecialcharsbx($arOrderTax["VALUE_MONEY"]) . "\" " . GetMessage("IncludedInSum") . "=\"" . ($arOrderTax["IS_IN_PRICE"] == "Y" ? 1 : 0) . "\"/>\n";
    }
    $dbBasket = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $f_ID));
    while ($arBasket = $dbBasket->Fetch()) {
        $CATALOG_XML_ID = $arBasket["CATALOG_XML_ID"];
        $PRODUCT_XML_ID = $arBasket["PRODUCT_XML_ID"];
        if (strlen($PRODUCT_XML_ID) <= 0 && strlen($CATALOG_XML_ID) <= 0) {
            $dbBasketProps = CSaleBasket::GetPropsList(array("CODE" => "ASC"), array("BASKET_ID" => $arBasket["ID"]));
            while ($arBasketProps = $dbBasketProps->Fetch()) {
                if ($arBasketProps["CODE"] == "CATALOG.XML_ID") {
                    $CATALOG_XML_ID = $arBasketProps["VALUE"];
                } elseif ($arBasketProps["CODE"] == "PRODUCT.XML_ID") {
                    $PRODUCT_XML_ID = $arBasketProps["VALUE"];
                    if (substr($PRODUCT_XML_ID, 0, 2) == "ID") {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:commerceml.php


示例13: DoSaveOrderTax

 static function DoSaveOrderTax($orderId, $taxList, &$arErrors)
 {
     $duplicateList = array();
     $idList = array();
     $res = CSaleOrderTax::GetList(array('ID' => 'ASC'), array("ORDER_ID" => $orderId), false, false, array("ID", "TAX_NAME", "CODE"));
     while ($data = $res->Fetch()) {
         $hash = $data["TAX_NAME"] . "|" . $data["CODE"];
         if (!array_key_exists($hash, $idList)) {
             $idList[$data["TAX_NAME"] . "|" . $data["CODE"]] = $data["ID"];
         } else {
             $duplicateList[$hash] = $data['ID'];
         }
     }
     $isChanged = false;
     if (is_array($taxList)) {
         foreach ($taxList as $itemData) {
             $fields = array("ORDER_ID" => $orderId, "TAX_NAME" => $itemData["NAME"], "IS_PERCENT" => $itemData["IS_PERCENT"], "VALUE" => $itemData["VALUE"], "VALUE_MONEY" => $itemData["VALUE_MONEY"], "APPLY_ORDER" => $itemData["APPLY_ORDER"], "IS_IN_PRICE" => $itemData["IS_IN_PRICE"], "CODE" => $itemData["CODE"]);
             $hash = $itemData["NAME"] . "|" . $itemData["CODE"];
             $isNew = false;
             if (array_key_exists($hash, $idList)) {
                 $taxId = CSaleOrderTax::Update($idList[$hash], $fields);
                 unset($idList[$hash]);
             } elseif (!array_key_exists($hash, $duplicateList)) {
                 $isNew = true;
                 $taxId = CSaleOrderTax::Add($fields);
             }
             if ($orderId > 0) {
                 \Bitrix\Sale\OrderHistory::addLog('TAX', $orderId, $isNew ? 'TAX_ADD' : 'TAX_UPDATE', $taxId, null, array("NAME" => $itemData["NAME"], "CODE" => $itemData["CODE"]), \Bitrix\Sale\OrderHistory::SALE_ORDER_HISTORY_LOG_LEVEL_1);
                 $isChanged = true;
             }
         }
     }
     foreach ($idList as $code => $id) {
         CSaleOrderTax::Delete($id);
         if ($orderId > 0) {
             \Bitrix\Sale\OrderHistory::addLog('TAX', $orderId, 'TAX_DELETED', $id, null, array(), \Bitrix\Sale\OrderHistory::SALE_ORDER_HISTORY_LOG_LEVEL_1);
         }
     }
     if (!empty($duplicateList)) {
         foreach ($duplicateList as $hash => $id) {
             CSaleOrderTax::Delete($id);
             \Bitrix\Sale\OrderHistory::addLog('TAX', $orderId, 'TAX_DUPLICATE_DELETED', $id, null, array(), \Bitrix\Sale\OrderHistory::SALE_ORDER_HISTORY_LOG_LEVEL_1);
         }
     }
     if ($isChanged) {
         \Bitrix\Sale\OrderHistory::addAction('TAX', $orderId, "TAX_SAVED");
     }
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:48,代码来源:tax.php


示例14: getTaxList

 public static function getTaxList($ID)
 {
     if (!CModule::IncludeModule('sale')) {
         return false;
     }
     $arResult = array();
     $dbTaxList = CSaleOrderTax::GetList(array("APPLY_ORDER" => "ASC"), array("ORDER_ID" => $ID));
     while ($arTaxList = $dbTaxList->Fetch()) {
         $arResult[] = array('IS_IN_PRICE' => $arTaxList['IS_IN_PRICE'], 'TAX_NAME' => $arTaxList['TAX_NAME'], 'IS_PERCENT' => $arTaxList['IS_PERCENT'], 'VALUE' => $arTaxList['VALUE'], 'VALUE_MONEY' => $arTaxList['VALUE_MONEY']);
     }
     return $arResult;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:12,代码来源:crm_invoice.php


示例15: ExportOrders2Xml


//.........这里部分代码省略.........
echo GetMessage("SALE_EXPORT_ROLE");
?>
>
					</<?php 
echo GetMessage("SALE_EXPORT_CONTRAGENT");
?>
>
				</<?php 
echo GetMessage("SALE_EXPORT_CONTRAGENTS");
?>
>

				<<?php 
echo GetMessage("SALE_EXPORT_TIME");
?>
><?php 
echo $DB->FormatDate($arOrder["DATE_INSERT_FORMAT"], $dateFormat, "HH:MI:SS");
?>
</<?php 
echo GetMessage("SALE_EXPORT_TIME");
?>
>
				<<?php 
echo GetMessage("SALE_EXPORT_COMMENTS");
?>
><?php 
echo htmlspecialcharsbx($arOrder["COMMENTS"]);
?>
</<?php 
echo GetMessage("SALE_EXPORT_COMMENTS");
?>
>
				<?
				$dbOrderTax = CSaleOrderTax::GetList(
					array(),
					array("ORDER_ID" => $arOrder["ID"]),
					false,
					false,
					array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE")
				);
				$i=-1;
				$orderTax = 0;
				while ($arOrderTax = $dbOrderTax->Fetch())
				{
					$arOrderTax["VALUE_MONEY"] = roundEx($arOrderTax["VALUE_MONEY"], 2);
					$orderTax += $arOrderTax["VALUE_MONEY"];
					$i++;
					if($i == 0)
						echo "<".GetMessage("SALE_EXPORT_TAXES").">";
					?>
					<<?php 
echo GetMessage("SALE_EXPORT_TAX");
?>
>
						<<?php 
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
><?php 
echo htmlspecialcharsbx($arOrderTax["TAX_NAME"]);
?>
</<?php 
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
>
						<<?php 
echo GetMessage("SALE_EXPORT_IN_PRICE");
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:67,代码来源:export.php


示例16: DoubleVal

<p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;
text-align:center;line-height:normal'>&nbsp;</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"];
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:waybill.php


示例17: DoSaveOrderTax

 static function DoSaveOrderTax($orderId, $arTaxList, &$arErrors)
 {
     $arIDs = array();
     $dbResult = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "TAX_NAME", "CODE"));
     while ($arResult = $dbResult->Fetch()) {
         $arIDs[$arResult["TAX_NAME"] . "|" . $arResult["CODE"]] = $arResult["ID"];
     }
     if (is_array($arTaxList)) {
         foreach ($arTaxList as $arItem) {
             $arFields = array("ORDER_ID" => $orderId, "TAX_NAME" => $arItem["NAME"], "IS_PERCENT" => $arItem["IS_PERCENT"], "VALUE" => $arItem["VALUE"], "VALUE_MONEY" => $arItem["VALUE_MONEY"], "APPLY_ORDER" => $arItem["APPLY_ORDER"], "IS_IN_PRICE" => $arItem["IS_IN_PRICE"], "CODE" => $arItem["CODE"]);
             if (array_key_exists($arItem["NAME"] . "|" . $arItem["CODE"], $arIDs)) {
                 CSaleOrderTax::Update($arIDs[$arItem["NAME"] . "|" . $arItem["CODE"]], $arFields);
                 unset($arIDs[$arItem["NAME"] . "|" . $arItem["CODE"]]);
             } else {
                 CSaleOrderTax::Add($arFields);
             }
         }
     }
     foreach ($arIDs as $id) {
         CSaleOrderTax::Delete($id);
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:22,代码来源:tax.php


示例18: Do


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CSaleOrderUserProps类代码示例发布时间:2022-05-20
下一篇:
PHP CSaleOrderPropsVariant类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap