本文整理汇总了PHP中CSaleOrderTax类的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderTax类的具体用法?PHP CSaleOrderTax怎么用?PHP CSaleOrderTax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSaleOrderTax类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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",
//.........这里部分代码省略.........
示例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");
示例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())
示例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>
示例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;
}
示例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"];
//.........这里部分代码省略.........
示例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");
示例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;
}
示例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") {
示例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");
}
}
示例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;
}
示例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");