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


PHP CSaleOrder::Update方法代码示例

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


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

示例1: chStatusOld

 public static function chStatusOld($id, $status)
 {
     try {
         self::$o_erip = new \Dm\Erip();
         self::$opt_status = \Bitrix\Main\Config\Option::get(self::$module_id, "order_status_code_erip");
         self::$opt_payment = \Bitrix\Main\Config\Option::get(self::$module_id, "payment_system_id");
         self::$values = CSaleOrder::GetList(array(), array("ID" => $id), false, false, array("ID", "PAY_SYSTEM_ID", "PRICE", "CURRENCY", "STATUS_ID"))->Fetch();
         if (self::$values["PAY_SYSTEM_ID"] == self::$opt_payment && $status != self::$values["STATUS_ID"] && $status == self::$opt_status) {
             static::setTehnicalInfo();
             static::setUserInfo();
             static::setMoneyInfo();
             $r = self::$o_erip->submit();
             self::$o_response = json_decode($r);
             if (isset(self::$o_response->errors)) {
                 throw new \Exception(self::$o_response->message);
             }
             if (CSaleOrder::Update($id, array("COMMENTS" => "status: " . self::$o_response->transaction->status . "\n" . "transaction_id: " . self::$o_response->transaction->transaction_id . "\n" . "order_id: " . self::$o_response->transaction->order_id . "\n" . "account_number: " . self::$o_response->transaction->erip->account_number . "\n"))) {
                 static::sendMail();
             }
             return true;
         }
     } catch (Exception $e) {
         $GLOBALS["APPLICATION"]->ThrowException($e->getMessage());
         return false;
     }
 }
开发者ID:dimabresky,项目名称:bitrix-Erip-module,代码行数:26,代码来源:Handlers.php

示例2: DoPayOrderFromAccount

 static function DoPayOrderFromAccount($userId, $currency, $orderId, $orderSum, $arOptions, &$arErrors)
 {
     if (!array_key_exists("ONLY_FULL_PAY_FROM_ACCOUNT", $arOptions)) {
         $arOptions["ONLY_FULL_PAY_FROM_ACCOUNT"] = COption::GetOptionString("sale", "ONLY_FULL_PAY_FROM_ACCOUNT", "N");
     }
     $dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => $userId, "CURRENCY" => $currency));
     $arUserAccount = $dbUserAccount->Fetch();
     if (!$arUserAccount) {
         return false;
     }
     if ($arUserAccount["CURRENT_BUDGET"] <= 0) {
         return false;
     }
     if ($arOptions["ONLY_FULL_PAY_FROM_ACCOUNT"] == "Y" && doubleval($arUserAccount["CURRENT_BUDGET"]) < doubleval($orderSum)) {
         return false;
     }
     $withdrawSum = CSaleUserAccount::Withdraw($userId, $orderSum, $currency, $orderId);
     if ($withdrawSum > 0) {
         $arFields = array("SUM_PAID" => $withdrawSum, "USER_ID" => $userId);
         CSaleOrder::Update($orderId, $arFields);
         if ($withdrawSum == $orderSum) {
             CSaleOrder::PayOrder($orderId, "Y", False, False);
         }
         return true;
     }
     return false;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:27,代码来源:user.php

示例3: onFinishChange

 /**
  * @param \DDelivery\Order\DDeliveryOrder $order
  * @throws \Bitrix\Main\ArgumentException
  */
 public function onFinishChange($order)
 {
     global $APPLICATION;
     $point = $order->getPoint();
     if ($order->type == DDeliverySDK::TYPE_SELF) {
         $replaceData = array('%1' => $order->cityName, '%2' => $point['address'], '%3' => $point['delivery_company_name'], '%4' => $point['_id'], '%5' => $point['type'] == 1 ? 'Постомат' : 'ПВЗ');
         $replaceData = $APPLICATION->ConvertCharsetArray($replaceData, 'UTF-8', SITE_CHARSET);
         $comment = GetMessage('DDELIVERY_ABOUT_SELF', $replaceData);
     } else {
         if ($order->type == DDeliverySDK::TYPE_COURIER) {
             $replaceData = array('%1' => $order->getFullAddress(), '%2' => $point['delivery_company_name']);
             $replaceData = $APPLICATION->ConvertCharsetArray($replaceData, 'UTF-8', SITE_CHARSET);
             $comment = GetMessage('DDELIVERY_ABOUT_COURIER', $replaceData);
         } else {
             $comment = 'error';
         }
     }
     $orderId = $this->formData['bx_order_id'];
     $params = array('DD_ABOUT' => $comment, 'DD_LOCAL_ID' => $order->localId);
     $orderDeliveryTableData = OrderDeliveryTable::getList(array('filter' => array('ORDER_ID' => $orderId)))->fetch();
     if ($orderDeliveryTableData) {
         OrderDeliveryTable::update($orderDeliveryTableData['ID'], array('PARAMS' => serialize($params)));
     } else {
         OrderDeliveryTable::add(array('ORDER_ID' => $orderId, 'PARAMS' => serialize($params)));
     }
     $order = CSaleOrder::GetByID($orderId);
     $arDeliveryResult = CSaleDeliveryHandler::CalculateFull('ddelivery', 'ddelivery:all', $order, CSaleLang::GetLangCurrency(SITE_ID), SITE_ID);
     if ($arDeliveryResult['RESULT'] == 'OK') {
         CSaleOrder::Update($orderId, array('PRICE_DELIVERY' => $arDeliveryResult['VALUE']));
     }
 }
开发者ID:ASDAFF,项目名称:DDelivery,代码行数:35,代码来源:DDeliveryAdminShop.php

示例4: mark_order_as_error

	protected function mark_order_as_error($order, array $data) {
		CSaleOrder::Update($order['ID'], array(
			'PS_STATUS' => 'N',
			'PS_SUM' => $data['amount'],
			'PS_CURRENCY' => $data['currency'],
			'PS_STATUS_MESSAGE' => $data['message'],
			'PS_RESPONSE_DATE' => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat('FULL', LANG))),
		));
	}
开发者ID:ASDAFF,项目名称:bitrix-futupayments,代码行数:9,代码来源:result_rec.php

示例5: setPayed

 public function setPayed($value)
 {
     $value = (bool) $value ? 'Y' : 'N';
     if ($value == 'Y') {
         \CSaleOrder::PayOrder($this['ID'], 'Y');
     } else {
         $data = array('PAYED' => (bool) $value ? 'Y' : 'N', 'DATE_PAYED' => Date(\CDatabase::DateFormatToPHP(\CLang::GetDateFormat('FULL', LANG))), 'USER_ID' => $this['USER_ID']);
         return \CSaleOrder::Update($this['ID'], $data);
     }
 }
开发者ID:AlexSmerw,项目名称:domino,代码行数:10,代码来源:Order.class.php

示例6: ToUpper

    if ($lmi_payee_purse != $IdM) {
        $err = 3;
        $err_text = 'ERR: НЕВЕРЕН ID МАГАЗИНА : ' . $lmi_payee_purse;
    }
    if ($lmi_prerequest == 1) {
        if ($err != 0) {
            echo $err_text;
        } else {
            echo 'YES';
        }
    } else {
        $common_string = $lmi_payee_purse . $lmi_payment_amount . $lmi_payment_no . $lmi_mode . $lmi_sys_invs_no . $lmi_sys_trans_no . $lmi_sys_trans_date . $sk . $lmi_payer_purse . $lmi_payer_wm;
        $hash = ToUpper(md5($common_string));
        if ($err == 0) {
            if ($hash == $lmi_hash) {
                $strPS_STATUS_DESCRIPTION = "";
                $strPS_STATUS_DESCRIPTION .= "Идентификатор магазина - " . $lmi_payee_purse . "; ";
                $strPS_STATUS_DESCRIPTION .= "Внутренний номер платежа  в системе Z-PAYMENT - " . $lmi_sys_invs_no . "; ";
                $strPS_STATUS_DESCRIPTION .= "Внутренний номер счета в системе Z-PAYMENT - " . $lmi_sys_trans_no . "; ";
                $strPS_STATUS_DESCRIPTION .= "дата платежа - " . $lmi_sys_trans_date . "";
                $strPS_STATUS_MESSAGE = "";
                $strPS_STATUS_MESSAGE .= "кошелек покупателя или его e-mail  - " . $lmi_payer_purse . "; ";
                $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $lmi_payment_amount, "PS_CURRENCY" => $arOrder["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
                // You can comment this code if you want PAYED flag not to be set automatically
                CSaleOrder::PayOrder($arOrder["ID"], "Y");
                CSaleOrder::Update($arOrder["ID"], $arFields);
            }
        }
    }
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:z_payment_result.php

示例7: UnsetMark

 public static function UnsetMark($ID, $userID = 0)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID < 0) {
         return false;
     }
     $userID = IntVal($userID);
     $arFields = array("MARKED" => "N", "REASON_MARKED" => "", "EMP_MARKED_ID" => $userID, "=DATE_MARKED" => $DB->GetNowFunction());
     return CSaleOrder::Update($ID, $arFields);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:11,代码来源:order.php

示例8: if

				{
					if ($ex->GetID() == "RESERVATION_ERROR")
					{
						$errorMessageReserve = $ex->GetString();
					}
					else if ($ex->GetID() != "ALREADY_FLAG")
						$errorMessageTmp .= $ex->GetString();
				}
				else
					$errorMessageTmp .= GetMessage("ERROR_PAY_ORDER").". ";
			}

			unset($arAdditionalFields["NOT_CHANGE_STATUS"]);

			//update for change data
			$res = CSaleOrder::Update($ID, $arAdditionalFields);
		}

		$arResult["message"] = "ok";
		$arResult["PAYED"] = $PAYED;
		$arResult["BUDGET_ENABLE"] = 'N';

		if (strlen($errorMessageTmp) > 0)
			$arResult["message"] = $errorMessageTmp;
		elseif (!CSaleOrder::IsLocked($ID, $lockedBY, $dateLock))
		{
			$dbOrder = CSaleOrder::GetList(
				array("ID" => "DESC"),
				array("ID" => $ID),
				false,
				false,
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:order_detail.php

示例9: bxModifySaleMails


//.........这里部分代码省略.........

                                        $arBasket      = array();
                                        while ($arBasketItems = $dbBasketItems->GetNext()) {
                                            $strOrderList .= $arBasketItems["NAME"] . " - " . $arBasketItems["QUANTITY"] . " шт на " . SaleFormatCurrency($arBasketItems["PRICE"] * $arBasketItems["QUANTITY"], $arBasketItems["CURRENCY"]);
                                            $strOrderList .= "\n";
                                            $rows['summ']=$summ += roundEx($arBasketItems["PRICE"], SALE_VALUE_PRECISION) * DoubleVal($arBasketItems["QUANTITY"]);
                                            $weight += doubleval($arBasketItems['WEIGHT']);
                                            $arBasket[] = $arBasketItems;
                                        }
                                        $arOrderForDiscount = array(
                                            'SITE_ID'      => SITE_ID,
                                            'USER_ID'      => $arUser['ID'],
                                            'ORDER_PRICE'  => $summ,
                                            'ORDER_WEIGHT' => $weight,
                                            'BASKET_ITEMS' => $arBasket,
                                        );
                                        $arDiscountOptions  = array();
                                        $arDiscountErrors   = array();
                                        CSaleDiscount::DoProcessOrder($arOrderForDiscount, $arDiscountOptions, $arDiscountErrors);
                                        if($_REQUEST['comment'])
                                            $arOrderForDiscount['COMMENTS'] = $_REQUEST['comment'];
                                        if($arProperties_partners['DOSTAVKA']['VALUE']){
                                            $arOrderForDiscount["PRICE_DELIVERY"] = $arProperties_partners['DOSTAVKA']['VALUE'];
                                            $arOrderForDiscount["DELIVERY_ID"] = 3;
                                            $summ += intval($arProperties_partners['DOSTAVKA']['VALUE']);
                                            $arOrderForDiscount['ORDER_PRICE']=$summ;
                                        }
                                        $arOrderForDiscount['PRICE_BEFORE'] = $summ;
                                        $arOrderForDiscount['PRICE']        = $summ;
                                        $arOrderForDiscount['WEIGHT']       = $arOrderForDiscount['ORDER_WEIGHT'];
                                        /**
                                         * обновляем заказ
                                         */
                                        if (!CSaleOrder::Update($ORDER_ID, $arOrderForDiscount)) {
                                            $rows['err'] = 'Ошибка расчета цены заказа.';
                                            $fail          = true;
                                        }else{

                                            /**
                                             * перезагружаем свойства заказ из старого
                                             */
                                            $db_props_new = CSaleOrderPropsValue::GetOrderProps($ORDER_ID);
                                            $arFields_props_new = array();
                                            while ($arProps_new = $db_props_new->Fetch())
                                            {
                                                //_debug($arProps_new);
                                                foreach($arFields_props_old as $key_props_old=>$item_props_old){
                                                    if($arProps_new['CODE']==$key_props_old){
                                                        CSaleOrderPropsValue::Update($arProps_new['ID'], array("VALUE"=>$item_props_old['VALUE']));
                                                        unset($arFields_props_old[$key_props_old]);
                                                    }
                                                }

                                            }
                                            if(sizeof($arFields_props_old)>0){
                                                foreach($arFields_props_old as $key_props_old2=>$item_props_old2){
                                                    CSaleOrderPropsValue::Add(array(
                                                        'NAME'           => $item_props_old2['NAME'],
                                                        'CODE'           => $item_props_old2['CODE'],
                                                        'ORDER_PROPS_ID' => $item_props_old2['ORDER_PROPS_ID'],
                                                        'ORDER_ID'       => $ORDER_ID,
                                                        'VALUE'          => $item_props_old2['VALUE']
                                                    ));
                                                }
                                            }
                                            /**
开发者ID:ASDAFF,项目名称:gpbitrix,代码行数:67,代码来源:class.php

示例10: setIdAsAccountNumber

 /**
  * @internal
  * @param $id
  *
  * @return Sale\Result
  * @throws Exception
  * @throws \Bitrix\Main\ArgumentNullException
  */
 protected static function setIdAsAccountNumber($id)
 {
     $result = new Sale\Result();
     $isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N');
     if ($isOrderConverted == "Y") {
         $accountNumber = $id;
         for ($i = 1; $i <= 10; $i++) {
             try {
                 /** @var \Bitrix\Sale\Result $r */
                 $r = \Bitrix\Sale\Internals\OrderTable::update($id, array("ACCOUNT_NUMBER" => $accountNumber));
                 $res = $r->isSuccess(true);
             } catch (\Bitrix\Main\DB\SqlQueryException $exception) {
                 $res = false;
                 $accountNumber = $id . "-" . $i;
             }
             if ($res) {
                 break;
             }
         }
     } else {
         $res = CSaleOrder::Update($id, array("ACCOUNT_NUMBER" => $id), false);
     }
     if (!$res) {
         $result->addError(new Sale\ResultError(Loc::getMessage('SALE_ORDER_GENERATE_ACCOUNT_NUMBER_ORDER_NUMBER_IS_NOT_SET_AS_ID'), 'SALE_ORDER_GENERATE_ACCOUNT_NUMBER_ORDER_NUMBER_IS_NOT_SET_AS_ID'));
         return $result;
     }
     $result->setData(array('ACCOUNT_NUMBER' => $id));
     return $result;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:37,代码来源:order.php

示例11: __MakeOrder

		function __MakeOrder($prdCnt=1, $arData = Array())
		{
			global $APPLICATION, $USER, $DB;
			CModule::IncludeModule("iblock");
			CModule::IncludeModule("sale");
			CModule::IncludeModule("catalog");
			$arPrd = Array();
			$dbItem = CIBlockElement::GetList(Array("PROPERTY_MORE_PHOTO" => "DESC", "ID" => "ASC"), Array("IBLOCK_TYPE" => "offers", "IBLOCK_SITE_ID" => WIZARD_SITE_ID, "PROPERTY_NEWPRODUCT" => false), false, Array("nTopCount" => 10), Array("ID", "IBLOCK_ID", "XML_ID", "NAME", "DETAIL_PAGE_URL", "IBLOCK_XML_ID"));
			while($arItem = $dbItem->GetNext())
				$arPrd[] = $arItem;

			if(!empty($arPrd))
			{
				for($i=0; $i<$prdCnt;$i++)
				{
					$prdID = $arPrd[mt_rand(0, 9)];
					$arProduct = CCatalogProduct::GetByID($prdID["ID"]);
					$CALLBACK_FUNC = "";
					$arCallbackPrice = CSaleBasket::ReReadPrice($CALLBACK_FUNC, "catalog", $prdID["ID"], 1);

					$arFields = array(
							"PRODUCT_ID" => $prdID["ID"],
							"PRODUCT_PRICE_ID" => $arCallbackPrice["PRODUCT_PRICE_ID"],
							"PRICE" => $arCallbackPrice["PRICE"],
							"CURRENCY" => $arCallbackPrice["CURRENCY"],
							"WEIGHT" => $arProduct["WEIGHT"],
							"QUANTITY" => 1,
							"LID" => WIZARD_SITE_ID,
							"DELAY" => "N",
							"CAN_BUY" => "Y",
							"NAME" => $prdID["NAME"],
							"CALLBACK_FUNC" => $CALLBACK_FUNC,
							"MODULE" => "catalog",
							"PRODUCT_PROVIDER_CLASS" => "CCatalogProductProvider",
							"ORDER_CALLBACK_FUNC" => "",
							"CANCEL_CALLBACK_FUNC" => "",
							"PAY_CALLBACK_FUNC" => "",
							"DETAIL_PAGE_URL" => $prdID["DETAIL_PAGE_URL"],
							"CATALOG_XML_ID" => $prdID["IBLOCK_XML_ID"],
							"PRODUCT_XML_ID" => $prdID["XML_ID"],
							"VAT_RATE" => $arCallbackPrice['VAT_RATE'],
						);
					$addres = CSaleBasket::Add($arFields);
				}

				$arOrder = Array(
						"LID" => $arData["SITE_ID"],
						"PERSON_TYPE_ID" => $arData["PERSON_TYPE_ID"],
						"PAYED" => "N",
						"CANCELED" => "N",
						"STATUS_ID" => "N",
						"PRICE" => 1,
						"CURRENCY" => $arData["CURRENCY"],
						"USER_ID" => $arData["USER_ID"],
						"PAY_SYSTEM_ID" => $arData["PAY_SYSTEM_ID"],
						//"PRICE_DELIVERY" => $arData["PRICE_DELIVERY"],
						//"DELIVERY_ID" => $arData["DELIVERY_ID"],
					);

				$dbFUserListTmp = CSaleUser::GetList(array("USER_ID" => $arData["USER_ID"]));
				if(empty($dbFUserListTmp))
				{
					$arFields = array(
							"=DATE_INSERT" => $DB->GetNowFunction(),
							"=DATE_UPDATE" => $DB->GetNowFunction(),
							"USER_ID" => $arData["USER_ID"]
						);

					$ID = CSaleUser::_Add($arFields);
				}

				$orderID = CSaleOrder::Add($arOrder);
				CSaleBasket::OrderBasket($orderID, CSaleBasket::GetBasketUserID(), WIZARD_SITE_ID);
				$dbBasketItems = CSaleBasket::GetList(
						array("NAME" => "ASC"),
						array(
								"FUSER_ID" => CSaleBasket::GetBasketUserID(),
								"LID" => WIZARD_SITE_ID,
								"ORDER_ID" => $orderID
							),
						false,
						false,
						array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "PRICE", "WEIGHT", "NAME")
					);
				$ORDER_PRICE = 0;
				while ($arBasketItems = $dbBasketItems->GetNext())
				{
					$ORDER_PRICE += roundEx($arBasketItems["PRICE"], SALE_VALUE_PRECISION) * DoubleVal($arBasketItems["QUANTITY"]);
				}

				$totalOrderPrice = $ORDER_PRICE + $arData["PRICE_DELIVERY"];
				CSaleOrder::Update($orderID, Array("PRICE" => $totalOrderPrice));
				foreach($arData["PROPS"] as $val)
				{
					$arFields = Array(
							"ORDER_ID" => $orderID,
							"ORDER_PROPS_ID" => $val["ID"],
							"NAME" => $val["NAME"],
							"CODE" => $val["CODE"],
							"VALUE" => $val["VALUE"],
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:101,代码来源:step1.php

示例12: GetMessage

         } else {
             $arResult["ERROR_MESSAGE"] .= GetMessage("SALE_ERROR_ADD_ORDER") . "<br />";
         }
     } else {
         $arOrder = CSaleOrder::GetByID($arResult["ORDER_ID"]);
     }
 }
 if (strlen($arResult["ERROR_MESSAGE"]) <= 0) {
     CSaleBasket::OrderBasket($arResult["ORDER_ID"], CSaleBasket::GetBasketUserID(), SITE_ID, false);
     $dbBasketItems = CSaleBasket::GetList(array("ID" => "ASC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => $arResult["ORDER_ID"]), false, false, array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "PRICE", "WEIGHT", "NAME"));
     $arResult["ORDER_PRICE"] = 0;
     while ($arBasketItems = $dbBasketItems->GetNext()) {
         $arResult["ORDER_PRICE"] += DoubleVal($arBasketItems["PRICE"]) * DoubleVal($arBasketItems["QUANTITY"]);
     }
     $totalOrderPrice = $arResult["ORDER_PRICE"] + $arResult["DELIVERY_PRICE"] + $arResult["TAX_PRICE"] - $arResult["DISCOUNT_PRICE"];
     CSaleOrder::Update($arResult["ORDER_ID"], array("PRICE" => $totalOrderPrice));
 }
 if (strlen($arResult["ERROR_MESSAGE"]) <= 0) {
     //if($arResult["bUsingVat"] != "Y")
     //{
     $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);
     }
     //}
     /*
     elseif($arResult["vatRate"] > 0)
     {
     	$arFields = array(
     			"ORDER_ID" => $arResult["ORDER_ID"],
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:component.php

示例13: qiwiWalletXmlResponse

        }
    } else {
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_AUTH);
    }
}
if ($order = CSaleOrder::getById($_POST['bill_id'])) {
    $paidInfo = array("PS_STATUS" => $_POST['status'] == "paid" ? "Y" : "N", "PS_STATUS_CODE" => substr($_POST['status'], 0, 5), "PS_STATUS_MESSAGE" => Loc::getMessage("SALE_QWH_STATUS_MESSAGE_" . strtoupper($_POST['status'])), "PS_RESPONSE_DATE" => \Bitrix\Main\Type\DateTime::createFromTimestamp(time()), "PS_SUM" => (double) $_POST['amount'], "PS_CURRENCY" => $_POST['ccy'], "PS_STATUS_DESCRIPTION" => "");
    if ((int) $_POST['error']) {
        $paidInfo['PS_STATUS_DESCRIPTION'] = "Error: " . Loc::getMessage("SALE_QWH_ERROR_CODE_" . $_POST['error']);
        CSaleOrder::Update($order['ID'], $paidInfo);
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_OTHER);
    }
    foreach ($_POST as $key => $value) {
        $paidInfo['PS_STATUS_DESCRIPTION'] .= "{$key}:{$value}, ";
    }
    CSaleOrder::Update($order['ID'], $paidInfo);
    $changeStatusPay = CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY") == "Y";
    $difference = (double) $_POST['amount'] - (double) $order['PRICE'];
    if ($difference < 0) {
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_TOO_LOW);
    } elseif ($difference > 0) {
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_TOO_HIGH);
    } else {
        if ($_POST['status'] == "paid" && $changeStatusPay) {
            CSaleOrder::PayOrder($order['ID'], "Y", true, true);
        }
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_NONE);
    }
} else {
    qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_NOT_FOUND);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:result_rec.php

示例14: Exception

                 if (strlen($void) > 0) {
                     $query = new \beGateway\Void();
                 }
             }
         }
         $query->setParentUid($parent_uid);
         $query->money->setCents($amount);
         $response = $query->submit()->getResponse();
         if (isset($response->errors)) {
             throw new Exception($response->message);
         }
         if (is_array($uids) && !empty($uids)) {
             $uids[$response->transaction->uid] = $response->transaction->type;
         }
         $fields = array("PS_STATUS_DESCRIPTION" => json_encode($uids));
         CSaleOrder::Update($ID, $fields);
     }
 }
 $result = array();
 $result["order_id"] = $order["ID"];
 $result["amount"] = array("price" => $order["PRICE"], "currecy" => $order["CURRENCY"]);
 $user = CUser::GetList($by = "id", $o = "desc", array("ID" => $order["USER_ID"]), array("FIELDS" => array("ID", "NAME", "LAST_NAME")))->Fetch();
 if ($user["ID"] > 0) {
     $result["user"] = $user["NAME"] . " " . $user["LAST_NAME"];
 }
 $result["uids"] = $uids;
 $tabs = array(array("DIV" => "edit1", "TAB" => Loc::getMessage("DEVTM_BEGATEWAY_TAB_TITLE"), "ICON" => "main_user_edit", "TITLE" => Loc::getMessage("DEVTM_BEGATEWAY_TITLE_DESC")));
 $o_tab = new CAdminTabControl("tab_control", $tabs);
 require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
 $o_tab->Begin();
 $o_tab->BeginNextTab();
开发者ID:dimabresky,项目名称:bitrix-beGateway-module,代码行数:31,代码来源:begateway_transaction_payment.php

示例15: 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


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